\RippleRestClientURLFileOpen

A REST Client depends on `allow_url_fopen=true` in `php.ini`.

Summary

Methods
Properties
Constants
get()
post()
isAvailable()
$useragent
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$useragent

$useragent

Set the User-Agent for client.

Methods

get()

get(string $uri) : string

Perform a HTTP GET request.

Parameters

string $uri

Request URI.

Throws

\RippleRestProtocolError

if client returns non-200 responses or network problems.

Returns

string —

Response body.

post()

post(string $uri, mixed $body) : string

Perform a HTTP GET request.

Parameters

string $uri

Request URI.

mixed $body

Request body (JSON string / PHP array).

Throws

\RippleRestProtocolError

if client returns non-200 responses or network problems.

Returns

string —

Response body as JSON string.

isAvailable()

isAvailable() : boolean

Check if this client can be used.

Returns

boolean