Client

Struct Client 

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub fn new() -> Self

Source

pub fn reset(&mut self) -> &mut Self

重置全部

Source

pub fn debug(&mut self) -> &mut Self

Source

pub fn ca_pem(&mut self, ca_pem: &str) -> &mut Self

Source

pub fn pkcs12(&mut self, pkcs12: &str, password: &str) -> &mut Self

Source

pub fn http10(&mut self) -> &mut Self

Source

pub fn http11(&mut self) -> &mut Self

Source

pub fn http2(&mut self) -> &mut Self

Source

pub fn retry(&mut self, count: usize) -> &mut Self

设置重置

Source

pub fn auto_location(&mut self) -> &mut Self

Source

pub fn get(&mut self, url: &str) -> &mut Self

Source

pub fn post(&mut self, url: &str) -> &mut Self

Source

pub fn head(&mut self, url: &str) -> &mut Self

Source

pub fn delete(&mut self, url: &str) -> &mut Self

Source

pub fn method(&mut self, method: &str, url: &str) -> &mut Self

Source

pub fn header(&mut self, key: &str, value: JsonValue) -> &mut Self

Source

pub fn query(&mut self, key: &str, value: JsonValue) -> &mut Self

Source

pub fn raw_json(&mut self, data: JsonValue) -> &mut Self

请求JSON数据

Source

pub fn form_data(&mut self, data: JsonValue) -> &mut Self

请求FormData数据

Source

pub fn x_www_form_urlencoded(&mut self, data: JsonValue) -> &mut Self

表单urlencoded请求

Source

pub fn send(&mut self) -> Result<ClientResponse, String>

Trait Implementations§

Source§

impl Default for Client

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V