Struct pact_matching::models::Request
[−]
[src]
pub struct Request { pub method: String, pub path: String, pub query: Option<HashMap<String, Vec<String>>>, pub headers: Option<HashMap<String, String>>, pub body: OptionalBody, pub matching_rules: MatchingRules, }
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, String>>
Request headers
body: OptionalBody
Request body
matching_rules: MatchingRules
Request matching rules
Methods
impl Request
[src]
fn from_json(request_json: &Value, spec_version: &PactSpecification) -> Request
[src]
Builds a Request
from a Value
struct.
fn to_json(&self) -> Value
[src]
Converts this Request
to a Value
struct.
fn default_request() -> Request
[src]
Returns the default request: a GET request to the root.
fn differences_from(&self, other: &Request) -> Vec<(DifferenceType, String)>
[src]
Return a description of all the differences from the other request
Trait Implementations
impl PartialEq for Request
[src]
fn eq(&self, __arg_0: &Request) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Request) -> bool
[src]
This method tests for !=
.
impl Debug for Request
[src]
impl Clone for Request
[src]
fn clone(&self) -> Request
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Request
[src]
impl HttpPart for Request
[src]
fn headers(&self) -> &Option<HashMap<String, String>>
[src]
Returns the headers of the HTTP part.
fn body(&self) -> &OptionalBody
[src]
Returns the body of the HTTP part.
fn matching_rules(&self) -> &MatchingRules
[src]
Returns the matching rules of the HTTP part.
fn content_type(&self) -> String
[src]
Determins 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
fn detect_content_type(&self) -> String
[src]
Tries to detect the content type of the body by matching some regular expressions against the first 32 characters. Default to text/plain
if no match is found. Read more
fn content_type_enum(&self) -> DetectedContentType
[src]
Returns the general content type (ignoring subtypes)