PHP 클래스 yii\httpclient\Message

부터: 2.0
저자: Paul Klimov ([email protected])
상속: extends yii\base\Component
파일 보기 프로젝트 열기: yiisoft/yii2-httpclient 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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