View Full Version : cURL response header showing up in output

04-30-2006, 11: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.

05-01-2006, 12:22 AM
Nevermind. Found out that a value of "0" will not work for CURLOPT_HEADER. It must be boolean FALSE.