http10063%python.module
fault.web

Client and server common IETF HTTP tools for fault.kernel based applications.

Properties

HeaderSequence

Type annotation for the header sequence used by Structures instances.

typing
import

collections0
import

itertools0
import

functools0
import

tools0
import

cachedproperty
import

cachedcalls0
import

timetypes0
import

memory0
import

protocol0
import

media0
import

ri0
import

core0
import

flows0
import

HeaderSequence0
data

HeaderSequence = typing.Sequence[typing.Tuple[bytes, bytes]]

ranges288%
function

ranges(length, range_header)

Generator producing the integer ranges specified by the given Range header.

rangesParameters

length

The Content-Length of the entity body being referenced.

range_header

The Range to be converted to slices.

decode_number

Undocumented.

Structures0
class

Manages a sequence of HTTP headers and cached access to specific ones.

Primarily used to extract information from received response (client) or request (server).

Structuresmethod
data

method = None

Structuresuri
data

uri = None

Structurespathstring
data

pathstring = None

Structuresquerystring
data

querystring = None

Structuresstatus
data

status = None

Structuresphrase
data

phrase = None

Structures_uri_struct10%
data

_uri_struct = None

_uri_struct(self)

Structures_uri_parts10%
data

_uri_parts = None

_uri_parts(self)

Structures__init__0
method

__init__(self, headers, *local)

Create a cache for a sequence of headers directly stored.

Structures__init__Parameters

self

Undocumented.

headers

The sequence of pairs designating the storage area to use.

local

Additional headers that should have cached access.

Structuresset_request80%
method

set_request(self, method, uri)

Configure the structure as representing a request received by a server.

Structuresset_status40%
method

set_status(self, status, phrase)

Configure the structure as representing a response received by a client.

Structuresredirected233%
property
bool

Whether the response is a redirect.

Structurescache0
method

cache(self)

Structures__str__10%
method

__str__(self)

Structures_init_headers191%
method

_init_headers(self, headers)

Set the headers to be cached and structured for use by an application.

Structurespath233%
property
typing.Sequence[str]

The sequence of path items in pathstring.

Structuresquery233%
property
typing.Optional[dict]

The query parameters of the URI.

Structuresupgrade233%
property
bool

Whether or not the request looking to perform protocol substitution.

Structurescontent420%
property
bool

Whether the headers indicate an associated body.

Structureslength712%
property
typing.Optional[int]

The length of the content; positive if exact, None if no content, and -1 if arbitrary. For HTTP, arbitrary triggers chunked transfer encoding.

Structuresbyte_ranges30%
method

byte_ranges(self, length)

The byte ranges of the request.

Structuresupgrade_insecure60%
method

upgrade_insecure(self)

The Upgrade-Insecure-Requests header as a boolean. None if not the header was not present, True if the header value was 1 and False if 0.

Structurescached_headers0
data

cached_headers = set(
	x.lower() for x in [
		b'Connection',
		b'Upgrade',
		b'Host',
		b'Upgrade-Insecure-Requests',
		b'Range',
		b'Expect',
			b'Transfer-Encoding',
		b'Transfer-Extension',
			b'TE',
		b'Trailer',
			b'Date',
		b'Last-Modified',
		b'Retry-After',
			b'Server',
		b'User-Agent',
		b'From',
		b'P3P',
			b'Accept',
		b'Accept-Encoding',
		b'Accept-Language',
		b'Accept-Ranges',
		b'Accept-Charset',
			b'Content-Type',
		b'Content-Language',
		b'Content-Length',
		b'Content-Range',
		b'Content-Location',
		b'Content-Encoding',
			b'Cache-Control',
		b'ETag',
		b'Expires',
		b'If-Match',
		b'If-Modified-Since',
		b'If-None-Match',
		b'If-Range',
		b'If-Unmodified-Since',
			b'Authorization',
		b'WWW-Authenticate',
		b'Proxy-Authenticate',
		b'Proxy-Authorization',
			b'Location',
		b'Max-Forwards',
			b'Via',
		b'Vary',
			b'Forwarded',
		b'X-Forwarded-For',
			b':Method',
		b':URI',
	]
)
	@property

Structuresconnection250%
property
bytes

Return the connection header stripped and lowered or b'' if no header present.

Structuresmedia_range_cache40%
staticmethod

media_range_cache(range_data)

Cached access to a media range header.

Structuresmedia_range30%
method

media_range(self)

Structured form of the Accept header.

Structuresmedia_type233%
method
media.Type

media_type(self)

The structured media type extracted from the Content-Type header.

Structuresdate420%
method
timetypes.Timestamp

date(self)

Date header timestamp.

Structureshost233%
property
str

Decoded host header.

Structuresencoding233%
property
str

Character encoding of entity content. None if not applicable.

Structuresfinal516%
property
bool

Whether this is suppoed to be the last transaction in the connection.

_join_send_wire20%
function

_join_send_wire(event, channel_id, transfer_events)

_join_send_content0
function

_join_send_content(event, channel_id, transfer_events)

_join_send_chunk0
function

_join_send_chunk(event, channel_id, transfer_events)

_join_send_eom0
function

_join_send_eom(event, channel_id, terminal)

_join_initiate_response277%
function

_join_initiate_response(shared, commands, sequence, event, channel_id, init)

_join_initiate_request370%
function

_join_initiate_request(shared, commands, sequence, event, channel_id, init)

join0
function

join(shared, sequence)

Join flow events into a proper HTTP stream.

_fork_response_sync0
function

_fork_response_sync(state)

Generator that can be used to communicate whether or not the response will have a body. Used with client disposition.

fork1570%
function

fork(shared, allocate, close, overflow)

Split an HTTP stream into flow events for use by fault.kernel.flows.Division.

TXProtocol0
class

Protocol class sending HTTP messages.

TXProtocolhttp_version10%
property

TXProtocolinitiate_server_request0
staticmethod

initiate_server_request(protocol, parameter)

Used by clients to select the proper initiation to send.

TXProtocolinitiate_client_response0
staticmethod

initiate_client_response(protocol, parameter)

Used by servers to select the proper initiation to send.

TXProtocol__init__0
method

__init__(self, state, initiate)

RXProtocol0
class

Protocol class receiving HTTP messages.

RXProtocolhttp_version10%
property

RXProtocolallocate_client_request0
staticmethod

allocate_client_request(parameter)

For use by server receiving the client request.

RXProtocolallocate_server_response0
staticmethod

allocate_server_response(parameter)

For use by clients receiving the server response.

RXProtocolp_close10%
method

p_close(self)

RXProtocolp_correlate20%
method

p_correlate(self, send)

RXProtocolp_overflowing30%
method

p_overflowing(self)

RXProtocol__init__0
method

__init__(self, state, allocate)

allocate_client_protocol0
function

allocate_client_protocol()

allocate_server_protocol0
function

allocate_server_protocol()

allocate_client_protocol_v10
data

allocate_client_protocol_v1 = allocate_client_protocol

allocate_server_protocol_v10
data

allocate_server_protocol_v1 = allocate_server_protocol