PHP Class LeagueWrap\Response

Afficher le fichier Open project: paquettg/leaguewrap Class Usage Examples

Protected Properties

Свойство Type Description
$code integer The HTTP code resulting from the request.
$content string The content of the response.
$headers array Request's headers.

Méthodes publiques

Méthode Description
__construct ( string $content, integer $code, array $headers = [] ) The primary content of the response.
__toString ( ) : string Returns the content of the response as a string.
getCode ( ) : integer Returns the code associated with the response.
getHeader ( string $name ) : string | null Return header's value by key.
getHeaders ( ) : array Return array of header from response in format header key => header value.
hasHeader ( string $name ) : boolean Check if header key is present

Method Details

__construct() public méthode

The primary content of the response.
public __construct ( string $content, integer $code, array $headers = [] )
$content string
$code integer
$headers array

__toString() public méthode

Returns the content of the response as a string.
public __toString ( ) : string
Résultat string

getCode() public méthode

Returns the code associated with the response.
public getCode ( ) : integer
Résultat integer

getHeader() public méthode

If the header is not present, return null.
public getHeader ( string $name ) : string | null
$name string
Résultat string | null

getHeaders() public méthode

Only one value per header key is allowed.
public getHeaders ( ) : array
Résultat array

hasHeader() public méthode

Check if header key is present
public hasHeader ( string $name ) : boolean
$name string
Résultat boolean

Property Details

$code protected_oe property

The HTTP code resulting from the request.
protected int $code
Résultat integer

$content protected_oe property

The content of the response.
protected string $content
Résultat string

$headers protected_oe property

Request's headers.
protected array $headers
Résultat array