[][src]Struct rttp_client::HttpClient

pub struct HttpClient { /* fields omitted */ }

Methods

impl HttpClient[src]

pub fn new() -> Self[src]

Create a HttpClient object.

Examples

use rttp_client::HttpClient;
let client = HttpClient::new();

impl HttpClient[src]

pub fn reset(&mut self) -> &mut Self[src]

Reset this request, The request only use once, This function can reset request.

pub fn get(&mut self) -> &mut Self[src]

Set get request

pub fn post(&mut self) -> &mut Self[src]

Set post request

pub fn put(&mut self) -> &mut Self[src]

Set put request

pub fn delete(&mut self) -> &mut Self[src]

Set delete request

pub fn options(&mut self) -> &mut Self[src]

Set options request

pub fn head(&mut self) -> &mut Self[src]

Set head request

pub fn method<S: AsRef<str>>(&mut self, method: S) -> &mut Self[src]

Set request by method

pub fn url<U: ToRoUrl>(&mut self, url: U) -> &mut Self[src]

Set request url.

pub fn config<C: AsRef<Config>>(&mut self, config: C) -> &mut Self[src]

Set request config

pub fn traditional(&mut self, traditional: bool) -> &mut Self[src]

Whether traditional request, if false, the same para name will be add []

pub fn path<S: AsRef<str>>(&mut self, path: S) -> &mut Self[src]

Add url path

pub fn encode(&mut self, encode: bool) -> &mut Self[src]

Whether encode para

pub fn proxy<P: AsRef<Proxy>>(&mut self, proxy: P) -> &mut Self[src]

Set proxy request

pub fn auth(&mut self) -> &mut Self[src]

Not support now

pub fn header<P: IntoHeader>(&mut self, header: P) -> &mut Self[src]

Add request header

pub fn cookie<S: AsRef<str>>(&mut self, cookie: S) -> &mut Self[src]

Add request cookie

pub fn content_type<S: AsRef<str>>(&mut self, content_type: S) -> &mut Self[src]

Set request content type

pub fn para<P: IntoPara>(&mut self, para: P) -> &mut Self[src]

Add request para

pub fn form<S: ToFormData>(&mut self, formdata: S) -> &mut Self[src]

Add request form data. include file

pub fn raw<S: AsRef<str>>(&mut self, raw: S) -> &mut Self[src]

Set request raw data

pub fn binary(&mut self, binary: Vec<u8>) -> &mut Self[src]

Set binary data

pub fn emit(&mut self) -> Result<Response>[src]

emit a request

Examples

HttpClient::new()
  .url("http://httpbin.org.get")
  .emit();

Trait Implementations

impl Default for HttpClient[src]

impl Debug for HttpClient[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,