Struct Http

Source
pub struct Http {
    pub res_headers: JsonValue,
    pub res_cookies: JsonValue,
    /* private fields */
}

Fields§

§res_headers: JsonValue§res_cookies: JsonValue

Implementations§

Source§

impl Http

Source

pub fn url(url: &str) -> Self

请求地址

Source

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

Bearer认证

Source

pub fn debug(&mut self, open: bool) -> &mut Self

调试 控制台将输出大量的信息以供

Source

pub fn progress(&mut self, open: bool) -> &mut Self

是否显示进程表

Source

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

设置头信息

Source

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

设置cookie

Source

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

设置认证账号

Source

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

POST 发送

Source

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

POST 发送

Source

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

POST json 发送

Source

pub fn patch(&mut self, body: JsonValue) -> &mut Self

patch 请求

Source

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

GET 请求

Source

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

download 下载

Source

pub fn response(&mut self) -> JsonValue

返回

Auto Trait Implementations§

§

impl Freeze for Http

§

impl !RefUnwindSafe for Http

§

impl Send for Http

§

impl !Sync for Http

§

impl Unpin for Http

§

impl !UnwindSafe for Http

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, 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.