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, pub generators: Generators, }
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
generators: Generators
Request generators
Methods
impl Request
[src]
impl Request
pub fn from_json(
request_json: &Value,
spec_version: &PactSpecification
) -> Request
[src]
pub fn from_json(
request_json: &Value,
spec_version: &PactSpecification
) -> Request
Builds a Request
from a Value
struct.
pub fn to_json(&self, spec_version: &PactSpecification) -> Value
[src]
pub fn to_json(&self, spec_version: &PactSpecification) -> Value
Converts this Request
to a Value
struct.
pub fn default_request() -> Request
[src]
pub fn default_request() -> Request
Returns the default request: a GET request to the root.
pub fn differences_from(&self, other: &Request) -> Vec<(DifferenceType, String)>
[src]
pub fn differences_from(&self, other: &Request) -> Vec<(DifferenceType, String)>
Return a description of all the differences from the other request
Trait Implementations
impl PartialEq for Request
[src]
impl PartialEq for Request
fn eq(&self, other: &Request) -> bool
[src]
fn eq(&self, other: &Request) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Request) -> bool
[src]
fn ne(&self, other: &Request) -> bool
This method tests for !=
.
impl Debug for Request
[src]
impl Debug for Request
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Request
[src]
impl Clone for Request
fn clone(&self) -> Request
[src]
fn clone(&self) -> Request
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for Request
[src]
impl Eq for Request
impl HttpPart for Request
[src]
impl HttpPart for Request
fn headers(&self) -> &Option<HashMap<String, String>>
[src]
fn headers(&self) -> &Option<HashMap<String, String>>
Returns the headers of the HTTP part.
fn body(&self) -> &OptionalBody
[src]
fn body(&self) -> &OptionalBody
Returns the body of the HTTP part.
fn matching_rules(&self) -> &MatchingRules
[src]
fn matching_rules(&self) -> &MatchingRules
Returns the matching rules of the HTTP part.
fn generators(&self) -> &Generators
[src]
fn generators(&self) -> &Generators
Returns the generators of the HTTP part.
fn content_type(&self) -> String
[src]
fn content_type(&self) -> String
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
fn detect_content_type(&self) -> String
[src]
fn detect_content_type(&self) -> String
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]
fn content_type_enum(&self) -> DetectedContentType
Returns the general content type (ignoring subtypes)
impl Hash for Request
[src]
impl Hash for Request