Struct longbridge_httpcli::HttpClient
source · pub struct HttpClient { /* private fields */ }Expand description
Longbridge HTTP client
Implementations§
source§impl HttpClient
impl HttpClient
sourcepub fn new(config: HttpClientConfig) -> Self
pub fn new(config: HttpClientConfig) -> Self
Create a new HttpClient
sourcepub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
Set the default header
sourcepub fn request(
&self,
method: Method,
path: impl Into<String>
) -> RequestBuilder<(), (), ()>
pub fn request(
&self,
method: Method,
path: impl Into<String>
) -> RequestBuilder<(), (), ()>
Create a new request builder
sourcepub async fn get_otp(&self) -> HttpClientResult<String>
pub async fn get_otp(&self) -> HttpClientResult<String>
Get the socket OTP(One Time Password)
Reference: https://open.longbridgeapp.com/en/docs/socket-token-api
sourcepub async fn get_otp_v2(&self) -> HttpClientResult<String>
pub async fn get_otp_v2(&self) -> HttpClientResult<String>
Get the socket OTP v2(One Time Password)
Reference: https://open.longbridgeapp.com/en/docs/socket-token-api
Trait Implementations§
source§impl Clone for HttpClient
impl Clone for HttpClient
source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more