AbstractApiCallerService
in package
AbstractYes
Table of Contents
Constants
- ACCEPTED_JSON_TYPES = ['application/json', 'application/hal+json']
Properties
- $client : Client|null
Methods
- requestJson() : array<string|int, mixed>
- Generic method to perform an HTTP request and decode JSON.
- assertOkJson() : void
- getBaseUri() : string
- getHttpClient() : Client
Constants
ACCEPTED_JSON_TYPES
protected
mixed
ACCEPTED_JSON_TYPES
= ['application/json', 'application/hal+json']
Properties
$client
protected
Client|null
$client
= null
Methods
requestJson()
Generic method to perform an HTTP request and decode JSON.
public
requestJson(string $method, string $uri[, array<string|int, mixed> $opts = [] ]) : array<string|int, mixed>
Parameters
- $method : string
- $uri : string
- $opts : array<string|int, mixed> = []
Return values
array<string|int, mixed>assertOkJson()
protected
assertOkJson(ResponseInterface $response) : void
Parameters
- $response : ResponseInterface
getBaseUri()
protected
abstract getBaseUri() : string
Return values
stringgetHttpClient()
protected
getHttpClient() : Client