Response (class)
Class Response
Implements methods for HTTP responses.
All of the following examples assume that $response
is an instance of this class.
Get header values
Header names are case-insensitive, but normalized to Title-Case when the response is parsed.
$val = $response->header('content-type');
Will read the Content-Type header. You can get all set headers using:
$response->header();
You can also get at the headers using object access. When getting headers with object access, you have to use case-sensitive header names:
$val = $response->headers['Content-Type'];