PHP Interface Analogic\ACME\ClientInterface

Datei anzeigen Open project: analogic/lescript

Public Methods

Method Description
__construct ( string $base ) Constructor
get ( string $url ) : array | string
getLastCode ( ) : integer Return the HTTP status code of the last request
getLastLinks ( ) : string[] Get all Link headers of the last request
getLastLocation ( ) : string | null Return the Location header of the last request
getLastNonce ( ) : mixed Returns the Replay-Nonce header of the last request
post ( string $url, array $data ) : array | string Send a POST request

Method Details

__construct() public method

Constructor
public __construct ( string $base )
$base string the ACME API base all relative requests are sent to

get() public method

public get ( string $url ) : array | string
$url string URL to request via get
return array | string the parsed JSON response, raw response on error

getLastCode() public method

Return the HTTP status code of the last request
public getLastCode ( ) : integer
return integer

getLastLocation() public method

returns null if last request had no location header
public getLastLocation ( ) : string | null
return string | null

getLastNonce() public method

if no request has been made, yet. A GET on $base/directory is done and the resulting nonce returned
public getLastNonce ( ) : mixed
return mixed

post() public method

Send a POST request
public post ( string $url, array $data ) : array | string
$url string URL to post to
$data array fields to sent via post
return array | string the parsed JSON response, raw response on error