xmlhttprequest responsetext coming for Accept header: text/xml , but server error for application/JSON
The correct mime type for JSON is application/json
, not application/JSON
. That might be the problem.
httpRequest.setRequestHeader('Accept', 'application/json');
The MIME type is json
and not JSON
.