pub struct BatchProxifiedResponse {
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Bytes,
}Expand description
A proxified batch part surfaced as a native Response-like value.
The part body is the raw upstream response (HTML, JSON, binary,
etc.) — not a JSON envelope. reqwest::Response is tied to a
live connection so we cannot re-synthesize one from bytes; this
struct carries the same fields a caller needs.
Fields§
§status: u16Upstream HTTP status code restored from X-Scrapfly-Scrape-Status.
headers: HashMap<String, String>Response headers: upstream headers (originally prefixed with
X-Scrapfly-Upstream- on the wire, stripped here) PLUS
Scrapfly metadata (X-Scrapfly-Log, X-Scrapfly-Content-Format,
X-Scrapfly-Log-Uuid). Content-Type is the upstream’s
content-type.
body: BytesRaw upstream body bytes.
Implementations§
Source§impl BatchProxifiedResponse
impl BatchProxifiedResponse
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Decode the body as UTF-8 text (mirrors reqwest::Response::text()).
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Convenience accessor for the response content-type.
Sourcepub fn scrapfly_log(&self) -> Option<&str>
pub fn scrapfly_log(&self) -> Option<&str>
Scrapfly log UUID (X-Scrapfly-Log if present, else X-Scrapfly-Log-Uuid).