1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 18:13:00 +01:00

Merge pull request #1104 from victorwelling/master

Fixed incorrect documentation on the return type of getHeader()
This commit is contained in:
Michael Dowling 2015-06-01 10:46:28 -07:00
commit d2386607c1

View File

@ -65,14 +65,15 @@ You can check if a request or response has a specific header using the
echo 'It is there';
}
You can retrieve a header value as a string using ``getHeader()``.
You can retrieve all the header values as an array of strings using
``getHeader()``.
.. code-block:: php
echo $request->getHeader('X-Foo'); // bar
$request->getHeader('X-Foo'); // ['bar']
// Retrieving a missing header returns an empty string.
echo $request->getHeader('X-Bar') // outputs nothing
// Retrieving a missing header returns an empty array.
$request->getHeader('X-Bar'); // []
You can iterate over the headers of a message using the ``getHeaders()``
method.