pub struct HttpResponse {
pub status: u16,
pub content_type: Option<String>,
pub body: Vec<u8>,
pub bytes_received: u64,
pub truncated: bool,
pub redirects: u32,
pub final_url: String,
}Expand description
A response that was fetched successfully.
status is the status code of the final response (after following redirects);
final_url is analogous.
Fields§
§status: u16§content_type: Option<String>The raw content-type header value (the tool layer should strip parameters like
boundary/charset to get the main type); None if the server did not set it.
body: Vec<u8>Body truncated to max_response_bytes.
bytes_received: u64Number of bytes the server actually sent (excluding bytes discarded by truncation — the backend stops reading when truncating, so this is approximate and for reference only).
truncated: booltrue if the body was truncated because it exceeded max_response_bytes.
redirects: u32Number of redirects followed. 0 means the first response was final.
final_url: StringThe final URL after following redirects; if no redirects were followed, this is
the same as request.url.
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
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 moreAuto 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