BodyHandler

Trait BodyHandler 

Source
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§

Source

fn body(&self) -> Vec<u8>

Returns the body of the current HTTP Flow.

Source

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 body size exceeds what the low-level host allows.

Implementors§