@@ -6,32 +6,32 @@ 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 you to set default values for given headers.
10
10
That means if a header is not set, it will be added.
11
- However, if the header already is present, the request is left unchanged.
11
+ However, if the header is already 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
31
31
------------------------
32
32
33
- The plugin ``HeaderSetPlugin `` allows to fix values of given header . That means that any request passing through
34
- this plugin will have the given value for given header.
33
+ The plugin ``HeaderSetPlugin `` allows you to fix values of given headers . That means that any request passing through
34
+ this plugin will have the given value for the given header.
35
35
36
36
.. code :: php
37
37
@@ -56,7 +56,7 @@ this plugin will have the given value for given header.
56
56
Removing headers
57
57
----------------
58
58
59
- The plugin ``HeaderRemovePlugin `` allows to remove given headers from the request.
59
+ The plugin ``HeaderRemovePlugin `` allows you to remove given headers from the request.
60
60
61
61
.. code :: php
62
62
@@ -79,7 +79,7 @@ The plugin ``HeaderRemovePlugin`` allows to remove given headers from the reques
79
79
Appending header values
80
80
-----------------------
81
81
82
- The plugin ``HeaderAppendPlugin `` allows to set headers or to add values to existing headers.
82
+ The plugin ``HeaderAppendPlugin `` allows you to set headers or to add values to existing headers.
83
83
That means if the request already has the given headers then the value will be appended to the current value
84
84
but if the request does not already have the given header, it will be added to the request with the given value.
85
85
@@ -108,10 +108,10 @@ but if the request does not already have the given header, it will be added to t
108
108
Mixing operations
109
109
-----------------
110
110
111
- Different header plugins can be mixed to achieve different behaviors
111
+ Different header plugins can be mixed together to achieve different behaviors
112
112
and you can use the same plugin for identical operations.
113
113
114
- The following example will force the ``User-Agent `` and the ``Accept `` header values while removing ``Cookie `` header:
114
+ The following example will force the ``User-Agent `` and the ``Accept `` header values while removing the ``Cookie `` header:
115
115
116
116
.. code :: php
117
117
0 commit comments