class DropboxClient (View source)

DropboxClient

Constants

BASE_PATH

Dropbox API Root URL.

CONTENT_PATH

Dropbox API Content Root URL.

Properties

protected DropboxHttpClientInterface $httpClient DropboxHttpClientInterface Implementation

Methods

__construct(DropboxHttpClientInterface $httpClient)

Create a new DropboxClient instance

setHttpClient(DropboxHttpClientInterface $httpClient)

Set the HTTP Client

string
getBasePath()

Get the API Base Path.

string
getContentPath()

Get the API Content Path.

array
buildAuthHeader(string $accessToken = '')

Get the Authorization Header with the Access Token.

array
buildContentTypeHeader(string $contentType = '')

Get the Content Type Header.

string
buildUrl(string $endpoint = '', string $type = 'api')

Build URL for the Request

sendRequest(DropboxRequest $request)

Send the Request to the Server and return the Response

array
prepareRequest(DropboxRequest $request)

Prepare a Request before being sent to the HTTP Client

Details

at line line 37
__construct(DropboxHttpClientInterface $httpClient)

Create a new DropboxClient instance

Parameters

DropboxHttpClientInterface $httpClient

at line line 48
DropboxHttpClientInterface getHttpClient()

Get the HTTP Client

Return Value

DropboxHttpClientInterface $httpClient

at line line 60
DropboxClient setHttpClient(DropboxHttpClientInterface $httpClient)

Set the HTTP Client

Parameters

DropboxHttpClientInterface $httpClient

Return Value

DropboxClient

at line line 72
string getBasePath()

Get the API Base Path.

Return Value

string API Base Path

at line line 82
string getContentPath()

Get the API Content Path.

Return Value

string API Content Path

at line line 94
protected array buildAuthHeader(string $accessToken = '')

Get the Authorization Header with the Access Token.

Parameters

string $accessToken Access Token

Return Value

array Authorization Header

at line line 106
protected array buildContentTypeHeader(string $contentType = '')

Get the Content Type Header.

Parameters

string $contentType Request Content Type

Return Value

array Content Type Header

at line line 121
protected string buildUrl(string $endpoint = '', string $type = 'api')

Build URL for the Request

Parameters

string $endpoint Relative API endpoint
string $type Endpoint Type

Return Value

string The Full URL to the API Endpoints

at line line 145
DropboxResponse sendRequest(DropboxRequest $request)

Send the Request to the Server and return the Response

Parameters

DropboxRequest $request

Return Value

DropboxResponse

Exceptions

DropboxClientException

at line line 176
protected array prepareRequest(DropboxRequest $request)

Prepare a Request before being sent to the HTTP Client

Parameters

DropboxRequest $request

Return Value

array [Request URL, Request Headers, Request Body]