Zend Framework  3.0
Public Member Functions | List of all members
Response Class Reference

Public Member Functions

 __construct ($statusCode, $body= '', array $headers=[])
 
 getStatusCode ()
 Retrieve the HTTP response status code.
Returns
int

 
 getBody ()
 Retrieve the response body.
Returns
string

 
 getHeaderLine ($name, $default=null)
 Retrieve a header (as a single line) from the response.Header name lookups MUST be case insensitive.Since the only header values the feed reader consumes are singular in nature, this method is expected to return a string, and not an array of values.
Parameters
string$nameHeader name to retrieve.
mixed$defaultDefault value to use if header is not present.
Returns
string

 

Constructor & Destructor Documentation

__construct (   $statusCode,
  $body = '',
array  $headers = [] 
)
Parameters
int$statusCode
string | object$body
array$headers
Exceptions
Exception\InvalidArgumentException

Member Function Documentation

getBody ( )

Retrieve the response body.

Returns
string

Implements ResponseInterface.

getHeaderLine (   $name,
  $default = null 
)

Retrieve a header (as a single line) from the response.Header name lookups MUST be case insensitive.Since the only header values the feed reader consumes are singular in nature, this method is expected to return a string, and not an array of values.

Parameters
string$nameHeader name to retrieve.
mixed$defaultDefault value to use if header is not present.
Returns
string

Implements HeaderAwareResponseInterface.

getStatusCode ( )

Retrieve the HTTP response status code.

Returns
int

Implements ResponseInterface.