PHP Класс FakeGuzzleClient, php-gds

Наследование: implements GuzzleHttp\ClientInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( $obj_response = null )
getConfig ( string | null $option = null ) : mixed Get a client configuration option.
getPostedParams ( )
getPostedUrl ( )
post ( $str_url, array $arr_params ) : Response Pretend to do a POST request
request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : Psr\Http\Message\ResponseInterface Create and send an HTTP request.
requestAsync ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : GuzzleHttp\Promise\PromiseInterface Create and send an asynchronous HTTP request.
send ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : Psr\Http\Message\ResponseInterface Send an HTTP request.
sendAsync ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : GuzzleHttp\Promise\PromiseInterface Asynchronously send an HTTP request.

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

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

public __construct ( $obj_response = null )

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

These options include default request options of the client, a "handler" (if utilized by the concrete client), and a "base_uri" if utilized by the concrete client.
public getConfig ( string | null $option = null ) : mixed
$option string | null The config option to retrieve.
Результат mixed

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

public getPostedParams ( )

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

public getPostedUrl ( )

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

Pretend to do a POST request
public post ( $str_url, array $arr_params ) : Response
$str_url
$arr_params array
Результат GuzzleHttp\Psr7\Response

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

Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
public request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : Psr\Http\Message\ResponseInterface
$method string HTTP method.
$uri string | Psr\Http\Message\UriInterface URI object or string.
$options array Request options to apply.
Результат Psr\Http\Message\ResponseInterface

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

Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
public requestAsync ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : GuzzleHttp\Promise\PromiseInterface
$method string HTTP method
$uri string | Psr\Http\Message\UriInterface URI object or string.
$options array Request options to apply.
Результат GuzzleHttp\Promise\PromiseInterface

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

Send an HTTP request.
public send ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface Request to send
$options array Request options to apply to the given request and to the transfer.
Результат Psr\Http\Message\ResponseInterface

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

Asynchronously send an HTTP request.
public sendAsync ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : GuzzleHttp\Promise\PromiseInterface
$request Psr\Http\Message\RequestInterface Request to send
$options array Request options to apply to the given request and to the transfer.
Результат GuzzleHttp\Promise\PromiseInterface