Type Alias SyncRequestBuilder

Source
pub type SyncRequestBuilder<'r, E> = RequestBuilder<'r, SyncRequestBody<'r>, E>;
Expand description

阻塞请求构建器

Aliased Type§

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

Implementations§

Source§

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

Source

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

设置 HTTP 请求体为输入流

Source

pub fn referenced_stream_as_body<T: Read + Reset + 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 fn multipart<'a>( &mut self, multipart: impl Into<SyncMultipart<'a>>, ) -> IoResult<&mut Self>

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

Source§

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

Source

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

阻塞发起 HTTP 请求