pub trait HeadersHandler {
// Required methods
fn headers(&self) -> Vec<(String, String)>;
fn header(&self, name: &str) -> Option<String>;
fn add_header(&self, name: &str, value: &str);
fn set_header(&self, name: &str, value: &str);
fn set_headers(&self, headers: Vec<(&str, &str)>);
fn remove_header(&self, name: &str);
}Expand description
A handler for accessing the headers of the current HTTP Flow.
Required Methods§
Sourcefn headers(&self) -> Vec<(String, String)>
fn headers(&self) -> Vec<(String, String)>
Returns a list of headers represented by pairs of name and value.
Sourcefn add_header(&self, name: &str, value: &str)
fn add_header(&self, name: &str, value: &str)
Adds a header value by name.
If there is a header with the same name, this method will keep that and adding another
header entry with the same name and the new value.
Sourcefn set_header(&self, name: &str, value: &str)
fn set_header(&self, name: &str, value: &str)
Sets a header value by name.
If there is a header with the same name, this method will replace the header value.
Sourcefn set_headers(&self, headers: Vec<(&str, &str)>)
fn set_headers(&self, headers: Vec<(&str, &str)>)
Sets a list of headers represented by pairs of name and value.
Sourcefn remove_header(&self, name: &str)
fn remove_header(&self, name: &str)
Removes a header by name if it exists.