Function reqwest::get [] [src]

pub fn get<T: IntoUrl>(url: T) -> Result<Response>

Shortcut method to quickly make a GET request.

See also the methods on the reqwest::Response type.

Examples

use std::io::Read;

let mut result = String::new();
reqwest::get("https://www.rust-lang.org")?
    .read_to_string(&mut result)?;

Errors

This function fails if:

  • native TLS backend cannot be initialized
  • supplied Url cannot be parsed
  • there was an error while sending request
  • redirect loop was detected
  • redirect limit was exhausted