 <p>The data you get back is clearly not a UTF-8 string containing JSON. We can see this because the string appears to be set to </p> <pre><code>Current character set: utf8 NULL </code></pre> <p>when the error message is printed out.</p> <p>I'd start by issuing the URL request from an ordinary web browser to make sure that the response is what you expect. </p>