CURL newline problem
Posted: Thu Nov 02, 2006 1:20 am
Hi,
I am getting some unwanted new lines from CURL when making a request...
The code I'm using...
The returned header in log.txt looks like this.
Notice the new lines after each "Set-Cookie" header. How can I prevent this?
Thanks,
- Sid
I am getting some unwanted new lines from CURL when making a request...
The code I'm using...
Code: Select all
$curl = curl_init ("http://$host".$request) ;
curl_setopt($curl, CURLOPT_HEADER, TRUE) ;
curl_setopt($curl, CURLOPT_HTTP_VERSION, $version) ;
curl_setopt($curl, CURLOPT_PORT, $port) ;
curl_setopt($curl, CURLOPT_CRLF, false) ; // Tried with this set to true also
curl_setopt($curl, CURLOPT_BINARYTRANSFER, TRUE) ; // Tried with this set to false also
$fp = fopen("log.txt", "wb") ;
curl_setopt($curl, CURLOPT_FILE, $fp) ;The returned header in log.txt looks like this.
Code: Select all
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 02 Nov 2006 07:12:39 GMT
Connection: close
Content-type: text/html
Page-Completion-Status: Normal
Page-Completion-Status: Normal
Page-Completion-Status: Normal
Set-Cookie: CFID=42767969; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; domain=.devx.com
;
Set-Cookie: CFMAGIC=42767969%3A78730831; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; domain=.devx.com
;
Set-Cookie: CFTOKEN=78730831; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; domain=.devx.com
;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">Thanks,
- Sid