Type Definition qiniu_http_client::AsyncRequestBuilder
source · [−]pub type AsyncRequestBuilder<'r, E> = RequestBuilder<'r, AsyncRequestBody<'r>, E>;
Expand description
异步请求构建器
Implementations
sourceimpl<'r, E: 'r> AsyncRequestBuilder<'r, E>
impl<'r, E: 'r> AsyncRequestBuilder<'r, E>
sourcepub fn stream_as_body(
&mut self,
body: impl AsyncRead + AsyncReset + Unpin + Debug + Send + Sync + 'static,
content_length: u64,
content_type: Option<Mime>
) -> &mut Self
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 请求体为异步输入流
sourcepub 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
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 请求体为异步输入流的可变引用
sourcepub fn bytes_as_body(
&mut self,
body: impl Into<Vec<u8>>,
content_type: Option<Mime>
) -> &mut Self
pub fn bytes_as_body(
&mut self,
body: impl Into<Vec<u8>>,
content_type: Option<Mime>
) -> &mut Self
设置 HTTP 请求体为内存数据
sourcepub fn referenced_bytes_as_body(
&mut self,
body: &'r [u8],
content_type: Option<Mime>
) -> &mut Self
pub fn referenced_bytes_as_body(
&mut self,
body: &'r [u8],
content_type: Option<Mime>
) -> &mut Self
设置 HTTP 请求体为内存数据的引用
sourcepub fn json(&mut self, body: impl Serialize) -> JsonResult<&mut Self>
pub fn json(&mut self, body: impl Serialize) -> JsonResult<&mut Self>
设置 HTTP 请求体为 JSON 对象
sourcepub fn post_form<I, K, V>(&mut self, iter: I) -> &mut Selfwhere
I: IntoIterator,
I::Item: Borrow<(K, Option<V>)>,
K: AsRef<str>,
V: AsRef<str>,
pub fn post_form<I, K, V>(&mut self, iter: I) -> &mut Selfwhere
I: IntoIterator,
I::Item: Borrow<(K, Option<V>)>,
K: AsRef<str>,
V: AsRef<str>,
设置 HTTP 请求体为表单对象
sourcepub async fn multipart<'a>(
&mut self,
multipart: impl Into<AsyncMultipart<'a>>
) -> IoResult<&mut RequestBuilder<'r, AsyncRequestBody<'r>, E>>
pub async fn multipart<'a>(
&mut self,
multipart: impl Into<AsyncMultipart<'a>>
) -> IoResult<&mut RequestBuilder<'r, AsyncRequestBody<'r>, E>>
设置 HTTP 请求体为 Multipart 表单对象
sourceimpl<'r, E: EndpointsProvider + Clone + 'r> AsyncRequestBuilder<'r, E>
impl<'r, E: EndpointsProvider + Clone + 'r> AsyncRequestBuilder<'r, E>
sourcepub async fn call(&mut self) -> ApiResult<AsyncResponse>
pub async fn call(&mut self) -> ApiResult<AsyncResponse>
异步发起 HTTP 请求