class documentation
class HTTPRequestWrappingIRequest: (source)
Implements interfaces: klein._imessage.IHTTPRequest
HTTP request.
This is an IHTTPRequest
implementation that wraps an IRequest
object.
Async Method | body |
The entity body, as bytes. |
Method | body |
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 |
The entity body, as bytes.
Returns | |
bytes | Undocumented |
Raises | |
FountAlreadyAccessedError | If 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 . |
The entity body, as a fount.
Returns | |
IFount | Undocumented |
Raises | |
FountAlreadyAccessedError | If 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 . |