MCPcopy Create free account
hub / github.com/emilk/ehttp / Response

Class Response

ehttp/src/types.rs:452–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450/// Response from a completed HTTP request.
451#[derive(Clone)]
452pub struct Response {
453 /// The URL we ended up at. This can differ from the request url when we have followed redirects.
454 pub url: String,
455
456 /// Did we get a 2xx response code?
457 pub ok: bool,
458
459 /// Status code (e.g. `404` for "File not found").
460 pub status: u16,
461
462 /// Status text (e.g. "File not found" for status code `404`).
463 pub status_text: String,
464
465 /// The returned headers.
466 pub headers: Headers,
467
468 /// The raw bytes of the response body.
469 pub bytes: Vec<u8>,
470}
471
472impl Response {
473 pub fn text(&self) -> Option<&str> {

Callers 2

fetch_streaming_blockingFunction · 0.85
fetch_jsvalue_streamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected