-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cannot stream request using CURLOPT_READFUNCTION without chunked encoding #8165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see your point (looks more like a feature request than a bug report, though), but exposing |
It could work with headers: I have also habit of setting |
yes, I wasn't quite sure about that. I'm fine either way :)
Yep. I didn't mean to suggest to simply expose it. However, I didn't have a good alternative that incorporates with the C-like curl-API we have in PHP.
Yes, I thought about it as well. Right now, if we pass a Content-Length header using However, overwriting Do you think we could set |
That would require PHP to actually parse the headers passed via It might be sensible to write to the internals mailing list to get more feedback on this issue. |
Description
Consider this curl code in C:
That results in the following HTTP request
When removing the
CURLOPT_POSTFIELDSIZE
options, the following request is issued:That is analogous to its PHP implementation:
However, PHP does not expose the constant
CURLOPT_POSTFIELDSIZE
, i.e. I have no option to tell curl the length of the request. As a result, I cannot stream a request body usingCURLOPT_READFUNCTION
without chunked encoding.PHP Version
8.0.12
Operating System
Ubuntu 21.10
The text was updated successfully, but these errors were encountered: