Closed brownmike closed 9 years ago
I just tried pasting this in to one of the automated tests and it parsed just fine. However, another case where ActiveRestClient::ResponseParseException may be raised is if the API doesn't return a Content-Type
HTTP header containing at least "json". Does your API send back that header?
If not, you should be able to use an after_request
callback to add it in.
I'm going to close this issue for now (as I can't reproduce it). Feel free to comment back if it's not working and I'll reopen it. If it's still not, can you please paste the entirety of your HTTP API response (including all headers) and I'll try to reproduce it using your response.
Ah, you're exactly right about the response header. It was sending back Content-Type: text/plain;charset=UTF-8
Thanks for the response!
I have an API that is returning valid JSON but I keep getting ActiveRestClient::ResponseParseException when it comes back.
For example, when I inspect the exception body I get this:
Which I can then parse just fine with
JSON.parse
Am I missing something here or is this a bug?
Thanks!