note 112326 added to function.curl-setopt
| From: | shiplu at programmer dot net | Date: | Sat, 01 Jun 2013 18:23:53 +0000 |
| Subject: | note 112326 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195025@lists.php.net to get a copy of this message | ||
CURLOPT_POST should be set before CURLOPT_POSTFIELDS. Otherwise you might encounter 411 Length
required error.
Following code generates "411 Length Required" on nginx/1.1.15
<?php
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt ($ch, CURLOPT_POST, 1);
?>
But this one works.
<?php
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields);
?>
----
Server IP: 116.193.170.18
Probable Submitter: 27.147.181.37
----
Manual Page -- http://php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/112326
Del: integrated -- https://master.php.net/note/delete/112326/integrated
Del: useless -- https://master.php.net/note/delete/112326/useless
Del: bad code -- https://master.php.net/note/delete/112326/bad+code
Del: spam -- https://master.php.net/note/delete/112326/spam
Del: non-english -- https://master.php.net/note/delete/112326/non-english
Del: in docs -- https://master.php.net/note/delete/112326/in+docs
Del: other reasons-- https://master.php.net/note/delete/112326
Reject -- https://master.php.net/note/reject/112326
Search -- https://master.php.net/manage/user-notes.php