In the bellow snipet you can see that i am trying to download some data from a website via their API in JSON format.
My problem is that when i try to get the data in json format (25 mb of text data) the php script send me a 200 response (which you can see below). But the weird part is that the script actualy finishes executing and the response is downloaded by my browser as a file.
The url if inputed into browser returns correct data, even via wget i can download the contents from this url.
Could it be that curl will pass through the respose from the server to my browser?
$ch = curl_init("https://example.com/api/json/view/view_name?authtoken=xxxyyyaaaa&raw=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec ($ch);
downloaded file "myscriptname.php" which contains:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>
AcceptHTTP header and see if that changes anything.