[][src]Struct easy_http_request::HttpRequest

pub struct HttpRequest<QK = String, QV = String, BK = String, BV = String, HK = String, HV = String> where
    QK: Eq + Hash + AsRef<str>,
    QV: AsRef<str>,
    BK: Eq + Hash + AsRef<str>,
    BV: AsRef<str>,
    HK: Eq + Hash + AsRef<str>,
    HV: AsRef<str>, 
{ pub method: HttpRequestMethod, pub url: Url, pub max_response_body_size: usize, pub max_redirect_count: usize, pub max_connection_time: u64, pub query: Option<HashMap<QK, QV>>, pub body: Option<HttpRequestBody<BK, BV>>, pub headers: Option<HashMap<HK, HV>>, pub allow_localhost: bool, }

The http request sender. See DefaultHttpRequest or StaticHttpRequest.

Fields

method: HttpRequestMethodurl: Urlmax_response_body_size: usize

The size limit of the response body.

max_redirect_count: usizemax_connection_time: u64

The time limit in milliseconds of a connection. 0 means the time is unlimited.

query: Option<HashMap<QK, QV>>body: Option<HttpRequestBody<BK, BV>>headers: Option<HashMap<HK, HV>>allow_localhost: bool

Methods

impl<QK: Eq + Hash + AsRef<str>, QV: AsRef<str>, BK: Eq + Hash + AsRef<str>, BV: AsRef<str>, HK: Eq + Hash + AsRef<str>, HV: AsRef<str>> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn new(
    method: HttpRequestMethod,
    url: Url
) -> HttpRequest<QK, QV, BK, BV, HK, HV>
[src]

pub fn get(url: Url) -> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn get_from_url_str<S: AsRef<str>>(
    url: S
) -> Result<HttpRequest<QK, QV, BK, BV, HK, HV>, HttpRequestError>
[src]

pub fn post(url: Url) -> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn post_from_url_str<S: AsRef<str>>(
    url: S
) -> Result<HttpRequest<QK, QV, BK, BV, HK, HV>, HttpRequestError>
[src]

pub fn put(url: Url) -> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn put_from_url_str<S: AsRef<str>>(
    url: S
) -> Result<HttpRequest<QK, QV, BK, BV, HK, HV>, HttpRequestError>
[src]

pub fn delete(url: Url) -> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn delete_from_url_str<S: AsRef<str>>(
    url: S
) -> Result<HttpRequest<QK, QV, BK, BV, HK, HV>, HttpRequestError>
[src]

pub fn head(url: Url) -> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn head_from_url_str<S: AsRef<str>>(
    url: S
) -> Result<HttpRequest<QK, QV, BK, BV, HK, HV>, HttpRequestError>
[src]

pub fn send(self) -> Result<HttpResponse, HttpRequestError>[src]

Send a request and drop this sender.

impl<QK: Eq + Hash + AsRef<str>, QV: AsRef<str>, BK: Eq + Hash + AsRef<str> + Clone, BV: AsRef<str> + Clone, HK: Eq + Hash + AsRef<str>, HV: AsRef<str>> HttpRequest<QK, QV, BK, BV, HK, HV>[src]

pub fn send_preserved(&self) -> Result<HttpResponse, HttpRequestError>[src]

Send a request and preserve this sender so that it can be used again.

Trait Implementations

impl<QK: Eq + Hash + AsRef<str> + Clone, QV: AsRef<str> + Clone, BK: Eq + Hash + AsRef<str> + Clone, BV: AsRef<str> + Clone, HK: Eq + Hash + AsRef<str> + Clone, HV: AsRef<str> + Clone> Clone for HttpRequest<QK, QV, BK, BV, HK, HV>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<QK, QV, BK, BV, HK, HV> Send for HttpRequest<QK, QV, BK, BV, HK, HV> where
    BK: Send,
    BV: Send,
    HK: Send,
    HV: Send,
    QK: Send,
    QV: Send

impl<QK, QV, BK, BV, HK, HV> Sync for HttpRequest<QK, QV, BK, BV, HK, HV> where
    BK: Sync,
    BV: Sync,
    HK: Sync,
    HV: Sync,
    QK: Sync,
    QV: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T