2
I’m sending a Curl to a URL that will return a JSON as a response.
By the browser, accompanying with firebug, the return is in JSON, but when I do the same procedure by PHP, it returns a page (which seems to have been processed with the return of JSON), so much so that if I put curlopt_followlocation, false
page return is blank.
How do I get the page back in JSON? I tried something like: curlopt_httpheader, array("accept: application/json")
and unsuccessfully.
I have an X page, where I get the answer from the Y page (where I use Curl), on page X the return of page Y comes in HTML instead of JSON, and when I tell Curl not to follow any followlocation the page comes back blank.
I would not like to do via AJAX, but in PHP.