Created
February 2, 2012 16:13
-
-
Save perusio/1724301 to your computer and use it in GitHub Desktop.
Workaround in PHP cURL for the 100-continue expectation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cURL obeys the RFCs as it should. Meaning that for a HTTP/1.1 backend if the POST size is above 1024 bytes | |
// cURL sends a 'Expect: 100-continue' header. The server acknowledges and sends back the '100' status code. | |
// cuRL then sends the request body. This is proper behaviour. Nginx supports this header. | |
// This allows to work around servers that do not support that header. | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); | |
// We're emptying the 'Expect' header, saying to the server: please accept the body right now. | |
// Read here: http://pilif.github.com/2007/02/the-return-of-except-100-continue/ |
Thanks for this!
ty
thanks
New URL for the cited source: https://blog.pilif.me/2007/02/02/the-return-of-except-100-continue/
Thank you! You save me
Thank you!
It worked.
Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
)