pipeline Package

Modules

aiohttp
async_abc
async_requests
requests

This module is the requests implementation of Pipeline ABC

universal

This module represents universal policy that works whatever the HTTPSender implementation

Classes

AsyncHTTPPolicy

An http policy ABC.

AsyncHTTPSender

An http sender ABC.

AsyncPipeline

A pipeline implementation.

This is implemented as a context manager, that will activate the context of the HTTP sender.

ClientRawResponse

Wrapper for response object. This allows for additional data to be gathereded from the response, for example deserialized headers. It also allows the raw response object to be passed back to the user.

HTTPPolicy

An http policy ABC.

HTTPSender

An http sender ABC.

Pipeline

A pipeline implementation.

This is implemented as a context manager, that will activate the context of the HTTP sender.

Request

Represents a HTTP request in a Pipeline.

URL can be given without query parameters, to be added later using "format_parameters".

Instance can be created without data, to be added later using "add_content"

Instance can be created without files, to be added later using "add_formdata"

Response

A pipeline response object.

The Response interface exposes an HTTP response object as it returns through the pipeline of Policy objects. This ensures that Policy objects have access to the HTTP response.

This also have a "context" dictionary where policy can put additional fields. Policy SHOULD update the "context" dictionary with additional post-processed field if they create them. However, nothing prevents a policy to actually sub-class this class a return it instead of the initial instance.

SansIOHTTPPolicy

Represents a sans I/O policy.

This policy can act before the I/O, and after the I/O. Use this policy if the actual I/O in the middle is an implementation detail.

Context is not available, since it's implementation dependent. if a policy needs a context of the Sender, it can't be universal.

Example: setting a UserAgent does not need to be tight to sync or async implementation or specific HTTP lib