Constants

DEFAULT_TIMEOUT_SECONDS

DEFAULT_TIMEOUT_SECONDS

The default number of seconds for a request to timeout.

Properties

$serviceScopes

$serviceScopes : array

Type

array — A keyed map of the API services.

$sessionId

$sessionId : string

Type

string — The session ID to be used in the request.

$service

$service : string

Type

string

$method

$method : string

Type

string — A valid HTTP method (GET, POST, PUT, DELETE)

$endpoint

$endpoint : string

Type

string — The API endpoint the request should call

$body

$body : string

Type

string — A JSON encoded string of parameters to be passed to the request.

$headers

$headers : array

Type

array — An array of HTTP headers

$timeout

$timeout : integer

Type

integer — The number of seconds before the request should time out.

Methods

__call()

__call(  $command,   $arguments) 

Parameters

$command
$arguments

__construct()

__construct(\AdventureRes\AdventureResApp  $app, string  $service, string  $method, string  $endpoint, string  $body, array  $headers = array(), integer|null  $timeout = null, string|null  $sessionId = null) 

AdventureResRequest constructor.

Parameters

\AdventureRes\AdventureResApp $app
string $service
string $method

GET or POST

string $endpoint
string $body
array $headers
integer|null $timeout
string|null $sessionId

getSessionId()

getSessionId() : string

Gets the stored session ID.

Returns

string

setSessionId()

setSessionId(string  $sessionId) 

Stores a session ID.

Parameters

string $sessionId

getService()

getService() : string

Gets the name of the service defined in the request.

Returns

string

setService()

setService(string  $service) 

Stores the name of the service.

Parameters

string $service

getMethod()

getMethod() : string

Gets the request method.

Returns

string

setMethod()

setMethod(string  $method) 

Sets the request method. Should be either GET or POST.

Parameters

string $method

getEndpoint()

getEndpoint() : string

Gets the defined endpoint for the request.

Returns

string

setEndpoint()

setEndpoint(string  $endpoint) 

Sets the endpoint for the request.

Parameters

string $endpoint

getBody()

getBody() : string

Gets the defined body for the request.

Returns

string

setBody()

setBody(string  $body) 

Sets the body for the request.

Parameters

string $body

getHeaders()

getHeaders() : array

Gets the defined headers for the request.

Returns

array

setHeaders()

setHeaders(array  $headers) 

Sets the headers for the request.

Parameters

array $headers

getTimeout()

getTimeout() : integer

Gets the defined timeout length for the request. (Seconds)

Returns

integer

setTimeout()

setTimeout(integer  $timeout) 

Sets the number of seconds before a request times out.

Parameters

integer $timeout

getUrl()

getUrl() : string

Gets the full URL for the request.

Returns

string