Hi everyone,
I'm trying to get the Actix Web Client to compile, as per the documentation:
https://actix.rs/api/actix-web/stable/actix_web/client/index.html
use actix_web::{actix, client};
fn main() { actix::run( || client::get("http://www.rust-lang.org") // <- Create request builder .header("User-Agent", "Actix-web") .finish().unwrap() .send() // <- Send http request .map_err(|_| ()) .and_then(|response| { // <- server http response println!("Response: {:?}", response); Ok(()) }) ); }
However, I get an error I cannot seem to work around:
no method named
map_err
found for typeactix_web::client::SendRequest
in the current scopehelp: items from traits can only be used if the trait is in scope
What am I doing wrong? Is the documention not correct any more?