PHP 클래스 SpotifyWebAPI\Request

파일 보기 프로젝트 열기: jwilsson/spotify-web-api-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$returnAssoc

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
parseBody ( string $body, integer $status ) : array | object Parse the response body and handle API errors.
parseHeaders ( string $headers ) : array Parse HTTP response headers.

메소드 상세

account() 공개 메소드

Make a request to the "account" endpoint.
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.
리턴 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.

api() 공개 메소드

Make a request to the "api" endpoint.
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.
리턴 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.

getReturnAssoc() 공개 메소드

Get a value indicating the response body type.
public getReturnAssoc ( ) : boolean
리턴 boolean Whether the body is returned as an associative array or an stdClass.

parseBody() 보호된 메소드

Parse the response body and handle API errors.
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.
리턴 array | object The parsed response body. Type is controlled by Request::setReturnAssoc().

parseHeaders() 보호된 메소드

Parse HTTP response headers.
protected parseHeaders ( string $headers ) : array
$headers string The raw, unparsed response headers.
리턴 array Headers as key–value pairs.

send() 공개 메소드

You'll probably want to use one of the convenience methods instead.
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.
리턴 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.

setReturnAssoc() 공개 메소드

Set the return type for the response body.
public setReturnAssoc ( boolean $returnAssoc ) : void
$returnAssoc boolean Whether to return an associative array or an stdClass.
리턴 void

프로퍼티 상세

$returnAssoc 보호되어 있는 프로퍼티

protected $returnAssoc