Property | Type | Description | |
---|---|---|---|
$client | Client; | The GuzzleHttp client to talk to the API. | |
$endpoint | string | The API endpoint. | |
$key | string | The API key. | |
$keyParam | string | For example, Last.fm use api_key, like this: https://ws.audioscrobbler.com/2.0?method=artist.getInfo&artist=Kamelot&api_key=API_KEY. | |
$responseFormat | |||
$secret | string | The API secret. |
Method | Description | |
---|---|---|
__call ( string $method, array $args ) : object | Make an HTTP call to the external resource. | |
__construct ( $key, $secret, $endpoint, |
||
buildUrl ( string $uri, boolean $appendKey = true ) : string | Turn a URI segment into a full API URL. | |
getClient ( ) : |
||
getEndpoint ( ) : string | ||
getKey ( ) : string | ||
getSecret ( ) : string | ||
request ( string $verb, string $uri, boolean $appendKey = true, array $params = [] ) : object | string | Make a request to the API. | |
setClient ( |
||
setEndpoint ( string $endpoint ) | ||
setKey ( string $key ) | ||
setSecret ( string $secret ) |
public __construct ( $key, $secret, $endpoint, |
||
$client |
public request ( string $verb, string $uri, boolean $appendKey = true, array $params = [] ) : object | string | ||
$verb | string | The HTTP verb |
$uri | string | The API URI (segment) |
$appendKey | boolean | Whether to automatically append the API key into the URI. While it's usually the case, some services (like Last.fm) requires an "API signature" of the request. Appending an API key will break the request. |
$params | array | An array of parameters |
return | object | string |
protected Client; $client | ||
return | Client; |
protected string $keyParam | ||
return | string |