Struct wclient::Request[][src]

pub struct Request {
    pub method: HttpMethod,
    pub url: String,
    // some fields omitted
}
Expand description

HTTP request

A request is composed of:

  • HTTP method (GET, POST, PUT, DELETE, … )
  • Target URL, for example, https://myservice.com/users
  • (optional) Request headers.
  • (optional) Request path parameters, for example, id in the URL https://myservice.com/users?id=1111.
  • (optional) Server cookies
  • (optional) Request body of type Vec[u8]

Request headers, parameters and cookies are represented by a pair of name and value strings. Additionally, a HttpConfig struct can be used to configure the HTTP connections stablished to send a Request and receive a Response.

For more information see HTTP Request.

Fields

method: HttpMethod

HTTP method

url: String

Target url

Implementations

Checks if this request has body

Sends the request to the target URL. Returns the Response message or std::io::Error if any issue happened.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.