class documentation

class HTTPRequestWrappingIRequest: (source)

Implements interfaces: klein._imessage.IHTTPRequest

View In Hierarchy

HTTP request.

This is an IHTTPRequest implementation that wraps an IRequest object.

Async Method bodyAsBytes The entity body, as bytes.
Method bodyAsFount The entity body, as a fount.
Property headers Entity headers.
Property method Request method.
Property uri Request URI.
Instance Variable _request Undocumented
Instance Variable _state Undocumented
async def bodyAsBytes(self): (source)

The entity body, as bytes.

Returns
bytesUndocumented
Raises
FountAlreadyAccessedErrorIf the fount has previously been accessed.
Notes
This necessarily reads the entire entity body into memory, which may be a problem if the body is large.
This method caches the body, which means that unlike self.bodyAsFount, calling it repeatedly will return the same data.
This method accesses the fount (via self.bodyAsFount), which means the fount will not be available afterwards, and that if self.bodyAsFount has previously been called directly, this method will raise FountAlreadyAccessedError.
def bodyAsFount(self): (source)

The entity body, as a fount.

Returns
IFountUndocumented
Raises
FountAlreadyAccessedErrorIf the fount has previously been accessed.
Note
The fount may only be accessed once. It provides a mechanism for accessing the body as a stream of data, potentially as it is read from the network, without having to cache the entire body, which may be large. Because there is no caching, it is not possible to "start over" by accessing the fount a second time. Attempting to do so will raise FountAlreadyAccessedError.
@property
headers: IHTTPHeaders = (source)

Entity headers.

@property
uri: DecodedURL = (source)

Request URI.

_request: IRequest = (source)

Undocumented

Undocumented