Type Alias AsyncRequestBuilder

Source
pub type AsyncRequestBuilder<'r, E> = RequestBuilder<'r, AsyncRequestBody<'r>, E>;
Expand description

异步请求构建器

Aliased Type§

struct AsyncRequestBuilder<'r, E> { /* private fields */ }

Implementations§

Source§

impl<'r, E: 'r> AsyncRequestBuilder<'r, E>

Source

pub fn stream_as_body( &mut self, body: impl AsyncRead + AsyncReset + Unpin + Debug + Send + Sync + 'static, content_length: u64, content_type: Option<Mime>, ) -> &mut Self

设置 HTTP 请求体为异步输入流

Source

pub fn referenced_stream_as_body<T: AsyncRead + AsyncReset + Unpin + Debug + Send + Sync>( &mut self, body: &'r mut T, content_length: u64, content_type: Option<Mime>, ) -> &mut Self

设置 HTTP 请求体为异步输入流的可变引用

Source

pub fn bytes_as_body( &mut self, body: impl Into<Vec<u8>>, content_type: Option<Mime>, ) -> &mut Self

设置 HTTP 请求体为内存数据

Source

pub fn referenced_bytes_as_body( &mut self, body: &'r [u8], content_type: Option<Mime>, ) -> &mut Self

设置 HTTP 请求体为内存数据的引用

Source

pub fn json(&mut self, body: impl Serialize) -> JsonResult<&mut Self>

设置 HTTP 请求体为 JSON 对象

Source

pub fn post_form<I, K, V>(&mut self, iter: I) -> &mut Self
where I: IntoIterator, I::Item: Borrow<(K, Option<V>)>, K: AsRef<str>, V: AsRef<str>,

设置 HTTP 请求体为表单对象

Source

pub async fn multipart<'a>( &mut self, multipart: impl Into<AsyncMultipart<'a>>, ) -> IoResult<&mut RequestBuilder<'r, AsyncRequestBody<'r>, E>>

设置 HTTP 请求体为 Multipart 表单对象

Source§

impl<'r, E: EndpointsProvider + Clone + 'r> AsyncRequestBuilder<'r, E>

Source

pub async fn call(&mut self) -> ApiResult<AsyncResponse>

异步发起 HTTP 请求