interface ClientInterface

Methods

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

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

useApplication(ApplicationInterface $application)

Sets the current application.

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

Set the application name and version.

useIntegration(IntegrationInterface $integration)

Sets the current integration.

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

Set the integration name and version.

getApi()

Returns a string representation of the API currently in use.

Details

at line 31
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

Exceptions

RuntimeException

at line 37
useApplication(ApplicationInterface $application)

Sets the current application.

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

Parameters

ApplicationInterface $application

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

deprecated 2.2.0 Use useApplication instead

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
useIntegration(IntegrationInterface $integration)

Sets the current integration.

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

Parameters

IntegrationInterface $integration

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

deprecated 2.2.0 Use useIntegration instead

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 64
getApi()

Returns a string representation of the API currently in use.