File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,25 +6,25 @@ Header plugins are useful to manage request headers. Many operations are possibl
6
6
Default headers values
7
7
----------------------
8
8
9
- The plugin ``HeaderDefaultPlugin `` allows to set default values for given headers.
9
+ The plugin ``HeaderDefaultsPlugin `` allows to set default values for given headers.
10
10
That means if a header is not set, it will be added.
11
11
However, if the header already is present, the request is left unchanged.
12
12
13
13
.. code :: php
14
14
15
15
use Http\Discovery\HttpClientDiscovery;
16
16
use Http\Client\Common\PluginClient;
17
- use Http\Client\Common\Plugin\HeaderDefaultPlugin ;
17
+ use Http\Client\Common\Plugin\HeaderDefaultsPlugin ;
18
18
19
19
$defaultUserAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1';
20
20
21
- $headerDefaultPlugin = new HeaderDefaultPlugin ([
21
+ $headerDefaultsPlugin = new HeaderDefaultsPlugin ([
22
22
'User-Agent' => $defaultUserAgent
23
23
]);
24
24
25
25
$pluginClient = new PluginClient(
26
26
HttpClientDiscovery::find(),
27
- [$headerDefaultPlugin ]
27
+ [$headerDefaultsPlugin ]
28
28
);
29
29
30
30
Mandatory headers values
You can’t perform that action at this time.
0 commit comments