pub struct RequestBuilder { /* private fields */ }Expand description
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub fn headers(
self,
headers: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn headers( self, headers: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
批量添加请求头
Sourcepub fn bearer_auth(self, token: impl AsRef<str>) -> Self
pub fn bearer_auth(self, token: impl AsRef<str>) -> Self
设置 Bearer Token 认证
Sourcepub fn basic_auth(
self,
username: impl AsRef<str>,
password: Option<&str>,
) -> Self
pub fn basic_auth( self, username: impl AsRef<str>, password: Option<&str>, ) -> Self
设置 Basic Auth 认证
Sourcepub fn queries(
self,
params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn queries( self, params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
批量添加查询参数
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
设置此请求的重试次数(覆盖客户端默认值)
Sourcepub fn with_cancellation(self, token: CancellationToken) -> CancellableRequest
pub fn with_cancellation(self, token: CancellationToken) -> CancellableRequest
附加取消令牌,使请求可取消
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RequestBuilder
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnwindSafe for RequestBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more