PHP Класс Airship\Engine\Hail

Abstracts away the network communications; silently enforces configuration (e.g. tor-only mode).
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$client Client
$supplierCache Airship\Engine\Continuum\Supplier[]

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

Метод Описание
__construct ( ClientInterface $client )
__debugInfo ( ) : array
downloadFile ( string $url, string $filename, array $params = [] ) : Psr\Http\Message\ResponseInterface Download a file over the Internet
get ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface Perform a GET request
getAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface Perform a GET request, asynchronously
getJSON ( string $url, array $params = [] ) : mixed Perform a GET request, get a decoded JSON response.
getReturnBody ( string $url, array $params = [] ) : string Perform a POST request, get the body
getSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed Perform a GET request, get a decoded JSON response.
params ( array $params = [], string $url = '' ) : array Make sure we include the default params
parseJSON ( Response $response ) : mixed Parse a signed JSON response
parseSignedJSON ( Response $response, SignaturePublicKey $publicKey ) : mixed Parse a signed JSON response
post ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface Perform a POST request
postAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface Perform a GET request, asynchronously
postJSON ( string $url, array $params = [] ) : mixed Perform a POST request, get a decoded JSON response.
postReturnBody ( string $url, array $params = [] ) : string Perform a POST request, get the body
postSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed Perform a POST request, get a decoded JSON response.

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

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

public __construct ( ClientInterface $client )
$client ClientInterface

__debugInfo() публичный метод

public __debugInfo ( ) : array
Результат array

downloadFile() публичный метод

Download a file over the Internet
public downloadFile ( string $url, string $filename, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string - the URL to request
$filename string - the name of the local file path
$params array
Результат Psr\Http\Message\ResponseInterface

get() публичный метод

Perform a GET request
public get ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Результат Psr\Http\Message\ResponseInterface

getAsync() публичный метод

Perform a GET request, asynchronously
public getAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Результат Psr\Http\Message\ResponseInterface

getJSON() публичный метод

Perform a GET request, get a decoded JSON response.
public getJSON ( string $url, array $params = [] ) : mixed
$url string
$params array
Результат mixed

getReturnBody() публичный метод

Perform a POST request, get the body
public getReturnBody ( string $url, array $params = [] ) : string
$url string
$params array
Результат string

getSignedJSON() публичный метод

Internally verifies an Ed25519 signature.
public getSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed
$url string
$publicKey SignaturePublicKey
$params array
Результат mixed

params() публичный метод

Make sure we include the default params
public params ( array $params = [], string $url = '' ) : array
$params array
$url string (used for decision-making)
Результат array

parseJSON() публичный метод

Parse a signed JSON response
public parseJSON ( Response $response ) : mixed
$response Response
Результат mixed

parseSignedJSON() публичный метод

Parse a signed JSON response
public parseSignedJSON ( Response $response, SignaturePublicKey $publicKey ) : mixed
$response Response
$publicKey SignaturePublicKey
Результат mixed

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

Perform a POST request
public post ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Результат Psr\Http\Message\ResponseInterface

postAsync() публичный метод

Perform a GET request, asynchronously
public postAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Результат Psr\Http\Message\ResponseInterface

postJSON() публичный метод

Perform a POST request, get a decoded JSON response.
public postJSON ( string $url, array $params = [] ) : mixed
$url string
$params array
Результат mixed

postReturnBody() публичный метод

Perform a POST request, get the body
public postReturnBody ( string $url, array $params = [] ) : string
$url string
$params array
Результат string

postSignedJSON() публичный метод

Internally verifies an Ed25519 signature.
public postSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed
$url string
$publicKey SignaturePublicKey
$params array
Результат mixed

Описание свойств

$client защищенное свойство

protected Client $client
Результат Client

$supplierCache защищенное свойство

protected Supplier[],Airship\Engine\Continuum $supplierCache
Результат Airship\Engine\Continuum\Supplier[]