Skip to content

Commit c8e5dd6

Browse files
Update http_client.rst
Integrating the findings of symfony/symfony#38082 (comment)
1 parent 5717ed7 commit c8e5dd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

http_client.rst

+5
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,11 @@ when the streams are large)::
642642
'body' => $formData->bodyToString(),
643643
]);
644644

645+
If you need to add a custom HTTP header to the upload, you can do::
646+
647+
$headers = $formData->getPreparedHeaders()->toArray();
648+
$headers[] = 'X-Foo: bar';
649+
645650
Cookies
646651
~~~~~~~
647652

0 commit comments

Comments
 (0)