Skip to content

Commit 22312d3

Browse files
committed
minor #14237 Update http_client.rst (ThomasLandauer)
This PR was merged into the 4.4 branch. Discussion ---------- Update http_client.rst Integrating the findings of symfony/symfony#38082 (comment) Commits ------- c8e5dd6 Update http_client.rst
2 parents f803d1e + c8e5dd6 commit 22312d3

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
@@ -637,6 +637,11 @@ when the streams are large)::
637637
'body' => $formData->bodyToString(),
638638
]);
639639

640+
If you need to add a custom HTTP header to the upload, you can do::
641+
642+
$headers = $formData->getPreparedHeaders()->toArray();
643+
$headers[] = 'X-Foo: bar';
644+
640645
Cookies
641646
~~~~~~~
642647

0 commit comments

Comments
 (0)