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

Fixed incorrect documentation on the return type of getHeader()

This commit is contained in:
Victor Welling 2015-06-01 16:42:35 +02:00
parent 8a313ec694
commit 89f1713171

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.