ClientImpl
Implement this to use different HTTP clients
Table of Contents
- __construct() : mixed
- Initializing the client
- request() : array<string|int, mixed>
- Making a request to the API
Methods
__construct()
Initializing the client
public
__construct(string $baseUrl, string $username, string $password) : mixed
Parameters
- $baseUrl : string
-
The base URL of the API
- $username : string
-
Username to authenticate the sigfox API by HTTP basic Authentication.
- $password : string
-
Password to authenticate the sigfox API by HTTP basic Authentication.
Return values
mixed —request()
Making a request to the API
public
request(string $method, string $url[, array<string|int, mixed> $body = null ][, array<string|int, mixed> $query = null ][, resource|string|StreamInterface $save = null ]) : array<string|int, mixed>
Parameters
- $method : string
-
The http method in lower case
- $url : string
-
The url without the base URL
- $body : array<string|int, mixed> = null
-
The request body as a JSON serializable array
- $query : array<string|int, mixed> = null
-
The URL encoded query as an associated array
- $save : resource|string|StreamInterface = null
-
Location or resource to save the response
Return values
array<string|int, mixed> —An array containing status code, response body and headers. status code should be an integer, the response body should be a Psr\Http\Message\StreamInterface and the headers should be array