pub trait BodyHandler {
// Required methods
fn body(&self) -> Vec<u8> ⓘ;
fn set_body(&self, body: &[u8]) -> Result<(), BodyError>;
}Expand description
A handler for accessing the body of the current HTTP Flow.
Required Methods§
Sourcefn set_body(&self, body: &[u8]) -> Result<(), BodyError>
fn set_body(&self, body: &[u8]) -> Result<(), BodyError>
Sets the body of the current HTTP Flow in binary format.
§Errors
This method will return an error in the following situations, but is not limited to just these cases:
- The current HTTP Flow does not have a body and it can not be injected.
- The
bodysize exceeds what the low-level host allows.