PHP Класс yii\httpclient\Message

С версии: 2.0
Автор: Paul Klimov ([email protected])
Наследование: extends yii\base\Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$client owner client instance.

Открытые методы

Метод Описание
__toString ( ) : string PHP magic method that returns the string representation of this object.
addCookies ( array $cookies ) Adds more cookies to the already defined ones.
addData ( array $data ) Adds data fields to the existing ones.
addHeaders ( array $headers ) Adds more headers to the already defined ones.
composeHeaderLines ( ) : array Composes raw header lines from [[headers]].
getContent ( ) : string Returns HTTP message raw content.
getCookies ( ) : CookieCollection | Cookie[] Returns the cookie collection.
getData ( ) : mixed Returns the data fields, parsed from raw content.
getFormat ( ) : string Returns body format.
getHeaders ( ) : HeaderCollection Returns the header collection.
hasCookies ( ) : boolean Checks of HTTP message contains any cookie.
hasHeaders ( ) : boolean Checks of HTTP message contains any header.
setContent ( string $content ) Sets the HTTP message raw content.
setCookies ( CookieCollection | Cookie[] | array $cookies ) Sets the cookies associated with HTTP message.
setData ( mixed $data ) Sets the data fields, which composes message content.
setFormat ( string $format ) Sets body format.
setHeaders ( array | HeaderCollection $headers ) Sets the HTTP headers associated with HTTP message.
toString ( ) : string Returns string representation of this HTTP message.

Защищенные методы

Метод Описание
defaultFormat ( ) : string Returns default format name.

Описание методов

__toString() публичный Метод

PHP magic method that returns the string representation of this object.
public __toString ( ) : string
Результат string the string representation of this object.

addCookies() публичный Метод

Adds more cookies to the already defined ones.
public addCookies ( array $cookies )
$cookies array additional cookies.

addData() публичный Метод

Adds data fields to the existing ones.
С версии: 2.0.1
public addData ( array $data )
$data array additional content data fields.

addHeaders() публичный Метод

Adds more headers to the already defined ones.
public addHeaders ( array $headers )
$headers array additional headers in format: [headerName => headerValue]

composeHeaderLines() публичный Метод

Each line will be a string in format: 'header-name: value'.
public composeHeaderLines ( ) : array
Результат array raw header lines.

defaultFormat() защищенный Метод

Returns default format name.
protected defaultFormat ( ) : string
Результат string default format name.

getContent() публичный Метод

Returns HTTP message raw content.
public getContent ( ) : string
Результат string raw body.

getCookies() публичный Метод

The cookie collection contains the cookies associated with HTTP message.
public getCookies ( ) : CookieCollection | Cookie[]
Результат yii\web\CookieCollection | yii\web\Cookie[] the cookie collection.

getData() публичный Метод

Returns the data fields, parsed from raw content.
public getData ( ) : mixed
Результат mixed content data fields.

getFormat() публичный Метод

Returns body format.
public getFormat ( ) : string
Результат string body format name.

getHeaders() публичный Метод

The header collection contains the HTTP headers associated with HTTP message.
public getHeaders ( ) : HeaderCollection
Результат yii\web\HeaderCollection the header collection

hasCookies() публичный Метод

Using this method you are able to check cookie presence without instantiating [[CookieCollection]].
public hasCookies ( ) : boolean
Результат boolean whether message contains any cookie.

hasHeaders() публичный Метод

Using this method you are able to check cookie presence without instantiating [[HeaderCollection]].
public hasHeaders ( ) : boolean
Результат boolean whether message contains any header.

setContent() публичный Метод

Sets the HTTP message raw content.
public setContent ( string $content )
$content string raw content.

setCookies() публичный Метод

Sets the cookies associated with HTTP message.
public setCookies ( CookieCollection | Cookie[] | array $cookies )
$cookies yii\web\CookieCollection | yii\web\Cookie[] | array cookie collection or cookies list.

setData() публичный Метод

Sets the data fields, which composes message content.
public setData ( mixed $data )
$data mixed content data fields.

setFormat() публичный Метод

Sets body format.
public setFormat ( string $format )
$format string body format name.

setHeaders() публичный Метод

Sets the HTTP headers associated with HTTP message.
public setHeaders ( array | HeaderCollection $headers )
$headers array | yii\web\HeaderCollection headers collection or headers list in format: [headerName => headerValue]

toString() публичный Метод

Returns string representation of this HTTP message.
public toString ( ) : string
Результат string the string representation of this HTTP message.

Описание свойств

$client публичное свойство

owner client instance.
public $client