Re: http 411 error with cURL
| From: | Marek Kilimajer | Date: | Sat, 09 Oct 2004 23:48:19 +0000 |
| Subject: | Re: http 411 error with cURL | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199089@lists.php.net to get a copy of this message | ||
Nick Wilson wrote:
* and then Marek Kilimajer declared....CURLOPT_HTTPHEADER - An array of HTTP header fields to set. curl_setopt($ch, CURLOPT_HTTPHEADERS, array('Content-Length' => $postL));Nick Wilson wrote:hmmm.. well, this is giving me the same curl_errno(22) http 411 $postF="s=$s&e=$e&a=" . urlencode($a) . "&em=" . urlencode($em) ."&x=" . $x . "&b=$b&t=" . urlencode($t) . "&p=$p"; $postL=strlen($postF); curl_setopt($ch, CURLOPT_POSTFIELDS,$postF); curl_setopt($ch, CURLOPT_HTTPHEADERS, "Content-Length: $postL");* and then Marek Kilimajer declared....This one. Don't forget to urlencode where necessarydo you know if the lenght includes the args? like this strlen("val=$var&val2=$var2");Opps! CURLOPT_HTTPHEADER I go play with it now ;-)Sorry, I got it mixed :) But you figured it out.
$result=curl_exec($ch);