Skip to main content

get

Function get 

Source
pub(crate) fn get(
    agent: &Agent,
    url: &str,
    range: Option<ByteRange>,
    headers: &[(HeaderName, HeaderValue)],
) -> Result<(Answer, Body), ConnectionError>
Expand description

Asks for url, or just range of it, sending headers too, giving what the server said and the body still to read. A server that can’t send part of a file sends all of it, which Answer::starts_at shows.

§Errors

When the request fails, or the server sends part of the file without saying which.