interface ClientInterface

Methods

request(string $method, string $uri, array $options = [])

Sends a request to the API, and returns a resource object.

setApplication(string $name, string $version = '')

Set the application name and version.

setIntegration(string $name, string $version = '')

Set the integration name and version.

string
getApi()

Returns a string representation of the API currently in use.

Details

at line 33
ResourceInterface request(string $method, string $uri, array $options = [])

Sends a request to the API, and returns a resource object.

Parameters

string $method The HTTP method
string $uri The URI path
array $options An array of optional parameters. The following keys are accepted: * query An array of query parameters that will be appended to the URI * headers An array of headers that will be added to the request * body The request body * host A string that can be used to override the default client base URI

Return Value

ResourceInterface

Exceptions

RuntimeException

at line 42
setApplication(string $name, string $version = '')

Set the application name and version.

The values are used as part of the X-Contentful-User-Agent header.

Parameters

string $name
string $version

at line 51
setIntegration(string $name, string $version = '')

Set the integration name and version.

The values are used as part of the X-Contentful-User-Agent header.

Parameters

string $name
string $version

at line 58
string getApi()

Returns a string representation of the API currently in use.

Return Value

string