PHP Class FakeGuzzleClient, php-gds

Inheritance: implements GuzzleHttp\ClientInterface
Datei anzeigen Open project: tomwalder/php-gds Class Usage Examples

Public Methods

Method Description
__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.

Method Details

__construct() public method

public __construct ( $obj_response = null )

getConfig() public method

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.
return mixed

getPostedParams() public method

public getPostedParams ( )

getPostedUrl() public method

public getPostedUrl ( )

post() public method

Pretend to do a POST request
public post ( $str_url, array $arr_params ) : Response
$str_url
$arr_params array
return GuzzleHttp\Psr7\Response

request() public method

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.
return Psr\Http\Message\ResponseInterface

requestAsync() public method

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.
return GuzzleHttp\Promise\PromiseInterface

send() public method

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.
return Psr\Http\Message\ResponseInterface

sendAsync() public method

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.
return GuzzleHttp\Promise\PromiseInterface