Transports

Transports are responsible for making the actual network requests, and handling the responses.

Whenever an action is taken on a link, the scheme of the URL is inspected, and the responsibility for making a request is passed to an appropriate transport class.

By default only an HTTP transport implementation is included, but this approach means that other network protocols can also be supported by Core API, while remaining transparent to the user of the client library.

Available transports

HTTPTransport

The HTTPTransport class supports the http and https schemes.

Instantiation

Signature: HTTPTransport(credentials=None, headers=None, session=None)

Making requests

The following describes how the various Link and Field properties are used when making an HTTP network request.

Link.action

The link action property is uppercased and then used to determine the HTTP method for the request.

If left blank then the GET method is used.

Link.encoding

The link encoding property is used to determine how any location='form' or location='body' parameters should be encoded in order to form the body of the request.

Supported encodings are:

If left blank and a request body is included, then 'application/json' is used.

Link.transform

The link transform property is only relevant when the link is contained in an embedded document. This allows hypermedia documents to effect partial updates.

If left blank and a link in an embedded document is acted on, then 'inplace' is used for 'PUT', 'PATCH', and 'DELETE' requests. For any other request 'new' is used.

Field.location

The link location property determines how the parameter is used to build the outgoing request.

If left blank, then 'query' is used for 'GET' and 'DELETE' requests. For any other request 'form' is used.

Custom transports

The transport interface is not yet finalized, as it may still be subject to minor changes in a future release.

External packages

No third party transport classes are currently available.