Skip to main content

convert_body

Function convert_body 

Source
pub fn convert_body(
    body: &str,
    source_url: &str,
    content_type_header: Option<&str>,
    options: &FetchOptions,
) -> FetchResult
Expand description

Convert a fetched body to a FetchResult, choosing how to treat it based on its Content-Type (or a sniff of the body). HTML is extracted; JSON is pretty-printed; other text is passed through verbatim; binary is summarized.