Struct pact_models::request::Request [−][src]
pub struct Request {
pub method: String,
pub path: String,
pub query: Option<HashMap<String, Vec<String>>>,
pub headers: Option<HashMap<String, Vec<String>>>,
pub body: OptionalBody,
pub matching_rules: MatchingRules,
pub generators: Generators,
}
Expand description
Struct that defines the request.
Fields
method: String
Request method
path: String
Request path
query: Option<HashMap<String, Vec<String>>>
Request query string
headers: Option<HashMap<String, Vec<String>>>
Request headers
body: OptionalBody
Request body
matching_rules: MatchingRules
Request matching rules
generators: Generators
Request generators
Implementations
Builds a Request
from a Value
struct.
Converts this Request
to a Value
struct.
👎 Deprecated since 0.6.0: please use default()
from the standard Default trait instead
please use default()
from the standard Default trait instead
Returns the default request: a GET request to the root.
Return a description of all the differences from the other request
Convert this interaction to V4 format
Trait Implementations
Returns the headers of the HTTP part.
Returns the headers of the HTTP part in a mutable form.
Returns the body of the HTTP part.
Returns a mutable pointer to the body of the HTTP part.
Returns the matching rules of the HTTP part.
Returns the matching rules of the HTTP part.
Returns the generators of the HTTP part.
Returns the generators of the HTTP part.
Lookup up the content type for the part
Tries to detect the content type of the body by matching some regular expressions against the first 32 characters. Read more
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. Read more
Checks if the HTTP Part has the given header
Checks if the HTTP Part has the given header
If the body is a textual type (non-binary)
Convenience method to add a header
Builds a map of generators from the generators and matching rules
Auto Trait Implementations
impl RefUnwindSafe for Request
impl UnwindSafe for Request
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more