From c8e5dd6aa9d2f1688dbc81af4072bd909b908ed0 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sun, 13 Sep 2020 17:02:25 +0200 Subject: [PATCH] Update http_client.rst Integrating the findings of https://github.com/symfony/symfony/issues/38082#issuecomment-690529165 --- http_client.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http_client.rst b/http_client.rst index 0d8648643b7..14c73d4eb82 100644 --- a/http_client.rst +++ b/http_client.rst @@ -642,6 +642,11 @@ when the streams are large):: 'body' => $formData->bodyToString(), ]); +If you need to add a custom HTTP header to the upload, you can do:: + + $headers = $formData->getPreparedHeaders()->toArray(); + $headers[] = 'X-Foo: bar'; + Cookies ~~~~~~~