Re: http 411 curl error [RESOLVED]
| From: | Nick Wilson | Date: | Sun, 10 Oct 2004 10:16:07 +0000 |
| Subject: | Re: http 411 curl error [RESOLVED] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199099@lists.php.net to get a copy of this message | ||
* and then Nick Wilson declared....
> hi all,
>
> Im getting an http 411 error when trying to post data with php's cURL
> functions. The spec says
>
> ***The message for this error code is "Length Required."
> The server refuses to accept the request without a defined Content-
> Length.***
Thanks to Marek for providing the hint about url encoding. FOr anyone
that has similar troubles here's the 'gotcha':
You have to urlencode() your CURLOPT_POSTFIEDS naturally, but you *also*
have to urlencode() your CURLOPT_REFERER and CURLOPT_USERAGENT strings
;-)
Cheers Marek!
--
Nick W