We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9c6102 commit d601255Copy full SHA for d601255
http_client.rst
@@ -631,6 +631,15 @@ according to the ``multipart/form-data`` content-type. The
631
'body' => $formData->bodyToIterable(),
632
]);
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::
637
+
638
+ $client->request('POST', 'https://...', [
639
+ // ...
640
+ 'body' => $formData->bodyToString(),
641
+ ]);
642
643
Cookies
644
~~~~~~~
645
0 commit comments