Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: what is application/x-json?

$
0
0
Hi bongdragon,

application/x-json is a MIME type (see http://en.wikipedia.org/wiki/MIME for more details on that). Casablanca expects that JSON payloads will have a MIME type of either application/json (the official MIME type for JSON), text/json, text/x-json, text/javascript, text/x-javascript, application/javascript, or application/x-javascript.

If you control the website you're connecting to, you should change the returned MIME type to application/json. If you do not control the website, you can work around this by using extract_string instead of extract_json and then passing it to
json::value obj = json::value::parse(extracted_string);
Sincerely,
roschuma

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>