bauhsoj
04-30-2006, 10:32 PM
I am trying to fetch a simple CSV text file using cURL in PHP. When I download it using my browser the file contacts the comma seperated values I expect. When I download it using cURL I get the following prepended onto the data returned:
HTTP/1.1 200 OK
Date: Sun, 30 Apr 2006 21:37:11 GMT
Server: Apache/2.0.51 (Fedora)
Last-Modified: Sun, 30 Apr 2006 04:23:36 GMT
Accept-Ranges: bytes
Content-Length: 46586
Connection: close
Content-Type: text/plain
This messes up fgetcsv() so I need to get rid of that response header. I have tried setting CURLOPT_HEADER to 0 but it still prepends the data. What option do I need to set in cURL to prevent this internet response header from being prepended to the data returned by curl_exec()?
By the way, CURLOPT_RETURNTRANSFER is set to 1.
HTTP/1.1 200 OK
Date: Sun, 30 Apr 2006 21:37:11 GMT
Server: Apache/2.0.51 (Fedora)
Last-Modified: Sun, 30 Apr 2006 04:23:36 GMT
Accept-Ranges: bytes
Content-Length: 46586
Connection: close
Content-Type: text/plain
This messes up fgetcsv() so I need to get rid of that response header. I have tried setting CURLOPT_HEADER to 0 but it still prepends the data. What option do I need to set in cURL to prevent this internet response header from being prepended to the data returned by curl_exec()?
By the way, CURLOPT_RETURNTRANSFER is set to 1.