File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -631,9 +631,11 @@ according to the ``multipart/form-data`` content-type. The
631
631
'body' => $formData->bodyToIterable(),
632
632
]);
633
633
634
- HttpClient will stream the upload of the body by default. This might not work with all
635
- servers, resulting in HTTP status code 411 ("Length Required") cause there is no
636
- ``Content-Length `` header. In this case, just turn the body into a string::
634
+ By default, HttpClient streams the body contents when uploading them. This might
635
+ not work with all servers, resulting in HTTP status code 411 ("Length Required")
636
+ because there is no ``Content-Length `` header. The solution is to turn the body
637
+ into a string with the following method (which will increase memory consumption
638
+ when the streams are large)::
637
639
638
640
$client->request('POST', 'https://...', [
639
641
// ...
You can’t perform that action at this time.
0 commit comments