When using Chrome or Safari, the Accept header is set to / (by the browser?), and all is good.
In Firefox (38.0.1), however, the Accept header is:
text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
and the API return SOAP instead of JSON. Which in turn causes JSON.parse() to fail with
JSON.parse: unexpected character at line 1 column 1 of the JSON data
A quick fix was to force the request header in forcetk.js blob():
request.setRequestHeader('Accept', '/');
When using Chrome or Safari, the Accept header is set to / (by the browser?), and all is good. In Firefox (38.0.1), however, the Accept header is: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 and the API return SOAP instead of JSON. Which in turn causes JSON.parse() to fail with JSON.parse: unexpected character at line 1 column 1 of the JSON data
A quick fix was to force the request header in forcetk.js blob(): request.setRequestHeader('Accept', '/');