RESTcli
in package
Tags
Table of Contents
Properties
- $baseUrl : string
- $client : Client
- $ecKey : PrivateKey
- $identity : string
- $platformInfo : string
- Value for the X-BitPay-Platform-Info header.
- $proxy : string
Methods
- __construct() : mixed
- RESTcli constructor.
- delete() : string
- Send DELETE request.
- get() : string
- Send GET request.
- getJsonDataFromResponse() : string
- Parse Response object into json
- init() : void
- Initialize Client.
- post() : string
- Send POST request.
- update() : string
- Send PUT request.
- hasError() : bool
- parseException() : void
Properties
$baseUrl
protected
string
$baseUrl
$client
protected
Client
$client
$ecKey
protected
PrivateKey
$ecKey
$identity
protected
string
$identity
$platformInfo
Value for the X-BitPay-Platform-Info header.
protected
string
$platformInfo
$proxy
protected
string
$proxy
Methods
__construct()
RESTcli constructor.
public
__construct(string $environment, PrivateKey $ecKey[, string|null $proxy = null ], string|null $platformInfo) : mixed
Parameters
- $environment : string
- $ecKey : PrivateKey
- $proxy : string|null = null
- $platformInfo : string|null
Tags
delete()
Send DELETE request.
public
delete(mixed $uri[, array<string|int, mixed>|null $parameters = null ]) : string
Parameters
- $uri : mixed
- $parameters : array<string|int, mixed>|null = null
Tags
Return values
stringget()
Send GET request.
public
get(mixed $uri[, array<string|int, mixed>|null $parameters = null ][, bool $signatureRequired = true ]) : string
Parameters
- $uri : mixed
- $parameters : array<string|int, mixed>|null = null
- $signatureRequired : bool = true
Tags
Return values
string —(json)
getJsonDataFromResponse()
Parse Response object into json
public
getJsonDataFromResponse(Response $response) : string
Parameters
- $response : Response
Tags
Return values
stringinit()
Initialize Client.
public
init() : void
Tags
post()
Send POST request.
public
post(mixed $uri[, array<string|int, mixed> $formData = [] ][, bool $signatureRequired = true ]) : string
Parameters
- $uri : mixed
- $formData : array<string|int, mixed> = []
- $signatureRequired : bool = true
Tags
Return values
string —(json)
update()
Send PUT request.
public
update(mixed $uri[, array<string|int, mixed> $formData = [] ]) : string
Parameters
- $uri : mixed
- $formData : array<string|int, mixed> = []
Tags
Return values
stringhasError()
private
hasError(array<string|int, mixed> $body) : bool
Parameters
- $body : array<string|int, mixed>
Return values
boolparseException()
private
parseException(RequestException $exception) : void
Parameters
- $exception : RequestException