Friday, 27 September 2013

curl put 411 required length

curl put 411 required length

I am trying to do a curl put with php using the below code. I am getting a
response from the server.
411 Length Required nginx/1.2.3
Here is the code:
curl_setopt($crl, CURLOPT_HTTPHEADER, array('Content-Type:
application/json','Content-Length:115'));
curl_setopt($crl, CURLOPT_POSTFIELDS,$data);
curl_setopt($crl, CURLOPT_PUT, true);
curl_setopt($crl,
CURLOPT_URL,"http://someurl.com?version=2.0&access_token=$access_token&response_format=json");
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crl, CURLOPT_VERBOSE, true);
curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, $timeout );
why is the length not getting noticed?

No comments:

Post a Comment