#[repr(C)]pub struct HttpRequestConfig {
pub timeout_secs: u64,
pub max_response_size: u64,
pub user_agent: AzString,
pub headers: HttpHeaderVec,
pub disable_tls_cert_verification: bool,
}Expand description
HTTP request configuration (C-compatible)
Fields§
§timeout_secs: u64Request timeout in seconds (default: 30)
max_response_size: u64Maximum response size in bytes (default: 100MB, 0 = unlimited)
user_agent: AzStringUser-Agent header value
headers: HttpHeaderVecAdditional headers
disable_tls_cert_verification: boolDisable TLS certificate verification (default: false). WARNING: This makes HTTPS connections vulnerable to MITM attacks. Use only for testing or when connecting to servers with self-signed or cross-signed certificates not in the Mozilla root store.
Implementations§
Source§impl HttpRequestConfig
impl HttpRequestConfig
Sourcepub const fn with_timeout(self, secs: u64) -> Self
pub const fn with_timeout(self, secs: u64) -> Self
Set timeout in seconds
Sourcepub const fn with_max_size(self, max_bytes: u64) -> Self
pub const fn with_max_size(self, max_bytes: u64) -> Self
Set maximum response size (0 = unlimited)
Sourcepub fn with_user_agent(self, ua: impl Into<String>) -> Self
pub fn with_user_agent(self, ua: impl Into<String>) -> Self
Set User-Agent header
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a header
Sourcepub fn http_get_default(_url: AzString) -> ResultHttpResponseHttpError
pub fn http_get_default(_url: AzString) -> ResultHttpResponseHttpError
Stub: http feature disabled.
Sourcepub fn http_get(&self, _url: AzString) -> ResultHttpResponseHttpError
pub fn http_get(&self, _url: AzString) -> ResultHttpResponseHttpError
Stub: http feature disabled.
Sourcepub fn download_bytes_default(_url: AzString) -> ResultU8VecHttpError
pub fn download_bytes_default(_url: AzString) -> ResultU8VecHttpError
Stub: http feature disabled.
Sourcepub fn download_bytes(&self, _url: AzString) -> ResultU8VecHttpError
pub fn download_bytes(&self, _url: AzString) -> ResultU8VecHttpError
Stub: http feature disabled.
Sourcepub fn is_url_reachable(_url: AzString) -> bool
pub fn is_url_reachable(_url: AzString) -> bool
Stub: http feature disabled.
Trait Implementations§
Source§impl Clone for HttpRequestConfig
impl Clone for HttpRequestConfig
Source§fn clone(&self) -> HttpRequestConfig
fn clone(&self) -> HttpRequestConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpRequestConfig
impl Debug for HttpRequestConfig
Auto Trait Implementations§
impl Freeze for HttpRequestConfig
impl RefUnwindSafe for HttpRequestConfig
impl Send for HttpRequestConfig
impl Sync for HttpRequestConfig
impl Unpin for HttpRequestConfig
impl UnsafeUnpin for HttpRequestConfig
impl UnwindSafe for HttpRequestConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more