Function get

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

Shortcut method to quickly make a blocking GET request.

NOTE: This function creates a new internal Client on each call, and so should not be used if making many requests. Create a Client instead.

Examples

# fn run() -> Result<(), reqwest::Error> {
let body = reqwest::blocking::get("https://www.rust-lang.org")?
    .text()?;
# Ok(())
# }
# fn main() { }

Errors

This function fails if: