pub struct HttpResponse {
pub status_code: u16,
pub status_text: String,
pub headers: HashMap<String, String>,
pub body: String,
pub is_success: bool,
pub request_method: String,
pub request_url: String,
pub request_body: String,
}Expand description
HTTP response from an API call
Fields§
§status_code: u16§status_text: String§headers: HashMap<String, String>§body: String§is_success: bool§request_method: String§request_url: String§request_body: StringImplementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn json(&self) -> Result<Value, OpenApiError>
pub fn json(&self) -> Result<Value, OpenApiError>
Try to parse the response body as JSON
Sourcepub fn to_mcp_content(&self) -> String
pub fn to_mcp_content(&self) -> String
Get a formatted response summary for MCP
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 · 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 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