[−][src]Trait pact_matching::models::HttpPart
Trait to specify an HTTP part of a message. It encapsulates the shared parts of a request and response.
Required methods
pub fn headers(&self) -> &Option<HashMap<String, Vec<String>>>
[src]
Returns the headers of the HTTP part.
pub fn headers_mut(&mut self) -> &mut HashMap<String, Vec<String>>
[src]
Returns the headers of the HTTP part in a mutable form.
pub fn body(&self) -> &OptionalBody
[src]
Returns the body of the HTTP part.
pub fn matching_rules(&self) -> &MatchingRules
[src]
Returns the matching rules of the HTTP part.
pub fn generators(&self) -> &Generators
[src]
Returns the generators of the HTTP part.
pub fn lookup_content_type(&self) -> Option<String>
[src]
Lookup up the content type for the part
Provided methods
pub fn detect_content_type(&self) -> Option<ContentType>
[src]
Tries to detect the content type of the body by matching some regular expressions against the first 32 characters.
pub fn content_type(&self) -> Option<ContentType>
[src]
Determine the content type of the HTTP part. If a Content-Type
header is present, the
value of that header will be returned. Otherwise, the body will be inspected.
pub fn has_header(&self, header_name: &String) -> bool
[src]
Checks if the HTTP Part has the given header
pub fn lookup_header_value(&self, header_name: &String) -> Option<String>
[src]
Checks if the HTTP Part has the given header
pub fn has_text_body(&self) -> bool
[src]
If the body is a textual type (non-binary)
pub fn add_header(&mut self, key: &str, val: Vec<&str>)
[src]
Convenience method to add a header