pigeon.middleware.components.connection¶
Module Contents¶
- class pigeon.middleware.components.connection.HTTPRequest(method: str, path: str, headers: dict = None, get: dict = None, data=None, files=None, protocol: str = '1.1', content_type=None, **kwargs)¶
Bases:
pigeon.http.message.HTTPMessage
An HTTP message (obv either response or request)
- property is_error¶
- class pigeon.middleware.components.connection.HTTPResponse(headers: dict = None, data: str = None, status: int = 200, cookies=None, protocol: str = '1.1', content_type=None, **kwargs)¶
Bases:
pigeon.http.message.HTTPMessage
An HTTP message (obv either response or request)
- property is_error¶
- class pigeon.middleware.components.connection.ConnectionComponent¶
Bases:
pigeon.middleware.components.MiddlewareComponent
Middleware component that can be used by a preprocessor or postprocessor to process requests.
- classmethod postprocess(response: pigeon.http.HTTPResponse, request: pigeon.http.HTTPRequest) pigeon.http.HTTPResponse ¶
- classmethod preprocess(request: pigeon.http.HTTPRequest) pigeon.http.HTTPRequest ¶
- classmethod is_keep_alive(request: pigeon.http.HTTPRequest) bool ¶
Checks if the Host header in the request has a valid hostname.