title: Error "BlockingClientInFutureContext" when trying to make a request from within an actix-web route handler function
body: <p>I am writing a web service with Rust 2018 Stable and Actix-Web. Using Reqwest, I am making an HTTP request to a diffent site <strong>from within one route handler</strong> function. Simplyfied it looks like this </p>
  
  <pre><code>extern crate reqwest;
  use actix_web;
  use reqwest::Url;
  
  pub fn testing(req: actix_web::HttpRequest) -&gt; actix_web::Result&lt;actix_web::HttpResponse&gt; {
      println!("&gt;&gt;&gt; testing request begin");
      let url = Url::parse("https://example.com/").unwrap();
      println!("&gt;&gt;&gt; testing url built");
      let req = reqwest::Client::new().post(url);
      println!("&gt;&gt;&gt; testing req prepared");
      let res_struct = req.send();
      println!("&gt;&gt;&gt; testing res_struct received");
      let res = res_struct.unwrap();
      println!("&gt;&gt;&gt; testing res unwrapped");
      Ok(format!("done.").into())
  }
  </code></pre>
  
  <p>That doesn't work, and I am getting the following error message (the error is printed 8 times, "worker:1" to "worker:8", despite calling the function only once):</p>
  
  <pre><code>thread 'actix-rt:worker:1' panicked at 'called `Result::unwrap()` 
  on an `Err` value: Error(BlockingClientInFutureContext, 
  "https://www.example.com/")', src/libcore/result.rs:999:5
  Panic in Arbiter thread, shutting down system.
  </code></pre>
  
  <p>Google didn't find anything useful on <em>"BlockingClientInFutureContext"</em>, but I am guessing it is somehow related to async/await or maybe Tokio's own futures? </p>
  
  <p>Thanks for any pointers about what to read up on. Also, I am new to Rust.</p>
  
  <p>The handler function <strong>is called from the Actix-Web HTttpServer</strong>:</p>
  
  <pre><code>HttpServer::new(|| App::new().service(
      web::resource("/testing").route(
          web::get().to(views::testing)
      )
  )).bind("127.0.0.1:8001")?.run()
  </code></pre>