Свойство | Type | Description | |
---|---|---|---|
$baseUrl | base request URL. | ||
$contentLoggingMaxSize | maximum symbols count of the request content, which should be taken to compose a log and profile messages. Exceeding content will be truncated. | ||
$formatters | the formatters for converting data into the content of the specified [[format]]. The array keys are the format names, and the array values are the corresponding configurations for creating the formatter objects. | ||
$parsers | the parsers for converting content of the specified [[format]] into the data. The array keys are the format names, and the array values are the corresponding configurations for creating the parser objects. | ||
$requestConfig | request object configuration. | ||
$responseConfig | response config configuration. |
Méthode | Description | |
---|---|---|
afterSend ( |
This method is invoked right after request is sent. | |
batchSend ( array $requests ) : |
Performs multiple HTTP requests in parallel. | |
beforeSend ( |
This method is invoked right before request is sent. | |
createRequest ( ) : |
||
createRequestLogToken ( string $method, string $url, array $headers, string $content ) : string | Composes the log/profiling message token for the given HTTP request parameters. | |
createResponse ( string $content = null, array $headers = [] ) : |
Creates a response instance. | |
delete ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
Creates 'DELETE' request. | |
get ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
Creates 'GET' request. | |
getFormatter ( string $format ) : yii\httpclient\FormatterInterface | Returns HTTP message formatter instance for the specified format. | |
getParser ( string $format ) : yii\httpclient\ParserInterface | Returns HTTP message parser instance for the specified format. | |
getTransport ( ) : |
||
head ( string $url, array $headers = [], array $options = [] ) : |
Creates 'HEAD' request. | |
options ( string $url, array $options = [] ) : |
Creates 'OPTIONS' request. | |
patch ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
Creates 'PATCH' request. | |
post ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
Creates 'POST' request. | |
put ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
Creates 'PUT' request. | |
send ( |
Performs given request. | |
setTransport ( |
Sets the HTTP message transport. It can be specified in one of the following forms: |
Méthode | Description | |
---|---|---|
createRequestShortcut ( string $method, string $url, array | string $data, array $headers, array $options ) : |
public afterSend ( |
||
$request | request instance. | |
$response | received response instance. |
public beforeSend ( |
||
$request | request instance. |
public createRequest ( ) : |
||
Résultat | request instance. |
public createResponse ( string $content = null, array $headers = [] ) : |
||
$content | string | raw content |
$headers | array | headers list. |
Résultat | request instance. |
public delete ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
||
$url | string | target URL. |
$data | array | string | if array - request data, otherwise - request content. |
$headers | array | request headers. |
$options | array | request options. |
Résultat | request instance. |
public get ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
||
$url | string | target URL. |
$data | array | string | if array - request data, otherwise - request content. |
$headers | array | request headers. |
$options | array | request options. |
Résultat | request instance. |
public getFormatter ( string $format ) : yii\httpclient\FormatterInterface | ||
$format | string | format name. |
Résultat | yii\httpclient\FormatterInterface | formatter instance. |
public getTransport ( ) : |
||
Résultat | HTTP message transport instance. |
public patch ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
||
$url | string | target URL. |
$data | array | string | if array - request data, otherwise - request content. |
$headers | array | request headers. |
$options | array | request options. |
Résultat | request instance. |
public post ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
||
$url | string | target URL. |
$data | array | string | if array - request data, otherwise - request content. |
$headers | array | request headers. |
$options | array | request options. |
Résultat | request instance. |
public put ( string $url, array | string $data = null, array $headers = [], array $options = [] ) : |
||
$url | string | target URL. |
$data | array | string | if array - request data, otherwise - request content. |
$headers | array | request headers. |
$options | array | request options. |
Résultat | request instance. |
public send ( |
||
$request | request to be sent. | |
Résultat | response instance. |
public setTransport ( |
||
$transport | HTTP message transport |
public $contentLoggingMaxSize |
public $formatters |
public $parsers |