note 83152 deleted from function.curl-setopt by danbrown

From: Date: Sun, 17 May 2009 17:22:10 +0000
Subject: note 83152 deleted from function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154972@lists.php.net to get a copy of this message
Note Submitter: f00f ---- Please note that the below is not entirely correct. This format will work partially, but does not always produce correct headers. The correct form for the same code is: <?php $str = array( "Accept-Language: en-us,en;q=0.5", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Keep-Alive: 300", "Connection: keep-alive" ); curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $str); ?> The appropriate newlines/cr's *should* be handled by curl. This realization has cost me many hours, because Host, User-Agent, Cache-Control, etc appear to be handled correctly with the string form, but Content-Length and Content-Type are duplicated and the second copy is not parsed correctly by the server!

« previous php.notes (#154972) next »