From 167b1fff73de67d31312287ebe9c00d7b3a9e605 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 23 Apr 2018 16:10:06 +0200 Subject: [PATCH 1/2] Mentioned the new feature to pass custom HTTP headers when submiting forms --- testing.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testing.rst b/testing.rst index f94f6276e7e..97b87cdb960 100644 --- a/testing.rst +++ b/testing.rst @@ -749,6 +749,16 @@ their type:: PHP format (it converts the keys with square brackets notation - e.g. ``my_form[subject]`` - to PHP arrays). +.. tip:: + + The ``submit()`` method defines a third optional argument to add custom + HTTP headers when submitting the form:: + + $client->submit($form, array(), array('Accept-Language' => 'es')); + + .. versionadded:: 4.1 + The feature to add custom HTTP headers was introduced in Symfony 4.1. + Adding and Removing Forms to a Collection ......................................... From 6b3fdd82818d392e92def0e8f9c416dc72e709a8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 23 Apr 2018 16:28:32 +0200 Subject: [PATCH 2/2] Fixed the format of the server HTTP header --- testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.rst b/testing.rst index 97b87cdb960..e6f33ff4b3e 100644 --- a/testing.rst +++ b/testing.rst @@ -754,7 +754,7 @@ their type:: The ``submit()`` method defines a third optional argument to add custom HTTP headers when submitting the form:: - $client->submit($form, array(), array('Accept-Language' => 'es')); + $client->submit($form, array(), array('HTTP_ACCEPT_LANGUAGE' => 'es')); .. versionadded:: 4.1 The feature to add custom HTTP headers was introduced in Symfony 4.1.