Property | Type | Description | |
---|---|---|---|
$returnAssoc |
Method | Description | |
---|---|---|
account ( string $method, string $uri, array $parameters = [], array $headers = [] ) : array | Make a request to the "account" endpoint. | |
api ( string $method, string $uri, array $parameters = [], array $headers = [] ) : array | Make a request to the "api" endpoint. | |
getReturnAssoc ( ) : boolean | Get a value indicating the response body type. | |
send ( string $method, string $url, array $parameters = [], array $headers = [] ) : array | Make a request to Spotify. | |
setReturnAssoc ( boolean $returnAssoc ) : void | Set the return type for the response body. |
Method | Description | |
---|---|---|
parseBody ( string $body, integer $status ) : array | object | Parse the response body and handle API errors. | |
parseHeaders ( string $headers ) : array | Parse HTTP response headers. |
public account ( string $method, string $uri, array $parameters = [], array $headers = [] ) : array | ||
$method | string | The HTTP method to use. |
$uri | string | The URI to request. |
$parameters | array | Optional. Query parameters. |
$headers | array | Optional. HTTP headers. |
return | array | Response data. - array|object body The response body. Type is controlled by Request::setReturnAssoc(). - string headers Response headers. - int status HTTP status code. - string url The requested URL. |
public api ( string $method, string $uri, array $parameters = [], array $headers = [] ) : array | ||
$method | string | The HTTP method to use. |
$uri | string | The URI to request. |
$parameters | array | Optional. Query parameters. |
$headers | array | Optional. HTTP headers. |
return | array | Response data. - array|object body The response body. Type is controlled by Request::setReturnAssoc(). - string headers Response headers. - int status HTTP status code. - string url The requested URL. |
public getReturnAssoc ( ) : boolean | ||
return | boolean | Whether the body is returned as an associative array or an stdClass. |
protected parseBody ( string $body, integer $status ) : array | object | ||
$body | string | The raw, unparsed response body. |
$status | integer | The HTTP status code, used to see if additional error handling is needed. |
return | array | object | The parsed response body. Type is controlled by Request::setReturnAssoc(). |
protected parseHeaders ( string $headers ) : array | ||
$headers | string | The raw, unparsed response headers. |
return | array | Headers as key–value pairs. |
public send ( string $method, string $url, array $parameters = [], array $headers = [] ) : array | ||
$method | string | The HTTP method to use. |
$url | string | The URL to request. |
$parameters | array | Optional. Query parameters. |
$headers | array | Optional. HTTP headers. |
return | array | Response data. - array|object body The response body. Type is controlled by Request::setReturnAssoc(). - array headers Response headers. - int status HTTP status code. - string url The requested URL. |
public setReturnAssoc ( boolean $returnAssoc ) : void | ||
$returnAssoc | boolean | Whether to return an associative array or an stdClass. |
return | void |