I am trying to parse JSON data in my Rails 4 application with JSON.parse
. I keep getting this error:
757: unexpected token at '<?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>BB0CDD4F68DBE9C0</RequestId><HostId>SwLqpcx7wpspbYzXONm1XGRG46dGHxnDroplppsxqtU4v/iVwEGOvpRWpBNR+LMPduTldva/5Nk=</HostId></Error>'
Looks like error response is not returned as JSON. You could do something like: