[][src]Function idcurl::get

pub fn get(url: &str) -> Result<Response>

Make a basic http GET request to the given URL

Returns an error if the url couldn't be parsed or the request couldn't be made.

The response is ready for reading as an std::io::Read, which you may want to convert to a std::io::BufRead.

let mut response = idcurl::get("http://example.com")
    .expect("failed to make HTTP request");
assert!(response.status().is_success());
response.copy_to(&mut std::io::stdout()).unwrap();