1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use http::HeaderMap;
use url::Url;

/// An HTTP request.
#[derive(Clone, Debug)]
pub struct HttpRequest {
    // These are all owned values so that the request can safely be passed between
    // threads.
    /// URL to which the HTTP request is being made.
    pub url: Url,
    /// HTTP request method for this request.
    pub method: http::method::Method,
    /// HTTP request headers to send.
    pub headers: HeaderMap,
    /// HTTP request body (typically for POST requests only).
    pub body: Option<Vec<u8>>,
}