pub struct HttpResponse { /* private fields */ }Expand description
Enhanced HTTP response wrapper with chainable methods
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if response indicates success (2xx status)
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if response indicates client error (4xx status)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if response indicates server error (5xx status)
Sourcepub fn content_length(&self) -> u64
pub fn content_length(&self) -> u64
Get content length from headers
Sourcepub fn json<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn json<T>(&self) -> Result<T>where
T: DeserializeOwned,
Parse response body as JSON
Sourcepub fn json_value(&self) -> Result<Value>
pub fn json_value(&self) -> Result<Value>
Parse response body as generic JSON value
Sourcepub fn into_inner(self) -> Response
pub fn into_inner(self) -> Response
Get the underlying modern Response
Sourcepub fn to_legacy(&self) -> LegacyResponse
pub fn to_legacy(&self) -> LegacyResponse
Convert to legacy Response format for backward compatibility
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
impl UnwindSafe for HttpResponse
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