PHP Class Airship\Engine\Hail

Abstracts away the network communications; silently enforces configuration (e.g. tor-only mode).
Afficher le fichier Open project: paragonie/airship Class Usage Examples

Protected Properties

Свойство Type Description
$client Client
$supplierCache Airship\Engine\Continuum\Supplier[]

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

public __construct ( ClientInterface $client )
$client ClientInterface

__debugInfo() public méthode

public __debugInfo ( ) : array
Résultat array

downloadFile() public méthode

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
Résultat Psr\Http\Message\ResponseInterface

get() public méthode

Perform a GET request
public get ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Résultat Psr\Http\Message\ResponseInterface

getAsync() public méthode

Perform a GET request, asynchronously
public getAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Résultat Psr\Http\Message\ResponseInterface

getJSON() public méthode

Perform a GET request, get a decoded JSON response.
public getJSON ( string $url, array $params = [] ) : mixed
$url string
$params array
Résultat mixed

getReturnBody() public méthode

Perform a POST request, get the body
public getReturnBody ( string $url, array $params = [] ) : string
$url string
$params array
Résultat string

getSignedJSON() public méthode

Internally verifies an Ed25519 signature.
public getSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed
$url string
$publicKey SignaturePublicKey
$params array
Résultat mixed

params() public méthode

Make sure we include the default params
public params ( array $params = [], string $url = '' ) : array
$params array
$url string (used for decision-making)
Résultat array

parseJSON() public méthode

Parse a signed JSON response
public parseJSON ( Response $response ) : mixed
$response Response
Résultat mixed

parseSignedJSON() public méthode

Parse a signed JSON response
public parseSignedJSON ( Response $response, SignaturePublicKey $publicKey ) : mixed
$response Response
$publicKey SignaturePublicKey
Résultat mixed

post() public méthode

Perform a POST request
public post ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Résultat Psr\Http\Message\ResponseInterface

postAsync() public méthode

Perform a GET request, asynchronously
public postAsync ( string $url, array $params = [] ) : Psr\Http\Message\ResponseInterface
$url string
$params array
Résultat Psr\Http\Message\ResponseInterface

postJSON() public méthode

Perform a POST request, get a decoded JSON response.
public postJSON ( string $url, array $params = [] ) : mixed
$url string
$params array
Résultat mixed

postReturnBody() public méthode

Perform a POST request, get the body
public postReturnBody ( string $url, array $params = [] ) : string
$url string
$params array
Résultat string

postSignedJSON() public méthode

Internally verifies an Ed25519 signature.
public postSignedJSON ( string $url, SignaturePublicKey $publicKey, array $params = [] ) : mixed
$url string
$publicKey SignaturePublicKey
$params array
Résultat mixed

Property Details

$client protected_oe property

protected Client $client
Résultat Client

$supplierCache protected_oe property

protected Supplier[],Airship\Engine\Continuum $supplierCache
Résultat Airship\Engine\Continuum\Supplier[]