PHP Class yii\httpclient\Response

Since: 2.0
Author: Paul Klimov ([email protected])
Inheritance: extends Message
Mostrar archivo Open project: yiisoft/yii2-httpclient Class Usage Examples

Public Methods

Method Description
getCookies ( )
getData ( )
getIsOk ( ) : boolean Checks if response status code is OK (status code = 20x)
getStatusCode ( ) : string Returns status code.

Protected Methods

Method Description
defaultFormat ( ) : string | null Returns default format automatically detected from headers and content.
detectFormatByContent ( string $content ) : null | string Detects response format from raw content.
detectFormatByHeaders ( HeaderCollection $headers ) : null | string Detects format from headers.

Private Methods

Method Description
getParser ( ) : yii\httpclient\ParserInterface
normalizeCookieParamName ( string $rawName ) : string
parseCookie ( string $cookieString ) : Cookie Parses cookie value string, creating a [[Cookie]] instance.

Method Details

defaultFormat() protected method

Returns default format automatically detected from headers and content.
protected defaultFormat ( ) : string | null
return string | null format name, 'null' - if detection failed.

detectFormatByContent() protected method

Detects response format from raw content.
protected detectFormatByContent ( string $content ) : null | string
$content string raw response content.
return null | string format name, 'null' - if detection failed.

detectFormatByHeaders() protected method

Detects format from headers.
protected detectFormatByHeaders ( HeaderCollection $headers ) : null | string
$headers yii\web\HeaderCollection source headers.
return null | string format name, 'null' - if detection failed.

getCookies() public method

public getCookies ( )

getData() public method

public getData ( )

getIsOk() public method

Checks if response status code is OK (status code = 20x)
public getIsOk ( ) : boolean
return boolean whether response is OK.

getStatusCode() public method

Returns status code.
public getStatusCode ( ) : string
return string status code.