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>
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 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 表单对象
Source§impl<'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 请求