Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

HTTP Utilites

Forwarded Element

class luxon.utils.http.ForwardedElement[source]

Representation of Forwarded header.

Reference to RFC 7239, Section 4.

src

The value of the ‘for’ parameter or if the parameter is absent None. Identifies the node making the request to the proxy.

Type:str
by

The value of the ‘by’ parameter or if the the parameter is absent None. Identifies the client-facing interface of the proxy.

Type:str
host

The value of the ‘host’ parameter or if the parameter is absent None. Provides the host request header field as received by the proxy.

Type:str
proto

The value of the ‘proto’ parameter or if the parameter is absent None. Indicates the protocol that was used to make the request to the proxy.

Type:str

Parse Forwarded Header

luxon.utils.http.parse_forwarded_header(forwarded)[source]

Parses the value of a Forwarded header.

Parse Forwarded headers as specified by RFC 7239:

  • Check that every value has valid syntax in general.
  • Un-escapes found escape sequences.
Parameters:forwarded (str) – Value of a Forwarded header
Returns:Sequence of ForwardedElement instances.
Return type:list

Content Type Encoding

luxon.utils.http.content_type_encoding(header)[source]

Gets the encoding from Content-Type header.

Parameters:header (str) – Content-Type header value.

HTTP Client

luxon.utils.http.Client(url=None, timeout=(2, 8), auth=None, verify=True, cert=None)[source]