Make the async Client default (#626)

The previously default Client is moved to `reqwest::blocking`, while the
async client becomes the main API.

Closes #622
This commit is contained in:
Sean McArthur
2019-09-09 17:20:51 -07:00
committed by GitHub
parent 5fb04356fc
commit 87a09322d6
30 changed files with 1110 additions and 1066 deletions

View File

@@ -186,7 +186,7 @@ impl Response {
/// # Example
///
/// ```
/// # use reqwest::r#async::Response;
/// # use reqwest::Response;
/// fn on_response(res: Response) {
/// match res.error_for_status() {
/// Ok(_res) => (),
@@ -216,7 +216,7 @@ impl Response {
/// # Example
///
/// ```
/// # use reqwest::r#async::Response;
/// # use reqwest::Response;
/// fn on_response(res: &Response) {
/// match res.error_for_status_ref() {
/// Ok(_res) => (),
@@ -347,25 +347,6 @@ struct ResponseUrl(Url);
pub trait ResponseBuilderExt {
/// A builder method for the `http::response::Builder` type that allows the user to add a `Url`
/// to the `http::Response`
///
/// # Example
///
/// ```
/// # extern crate url;
/// # extern crate http;
/// # extern crate reqwest;
/// # use std::error::Error;
/// use url::Url;
/// use http::response::Builder;
/// use reqwest::r#async::ResponseBuilderExt;
/// # fn main() -> Result<(), Box<dyn Error>> {
/// let response = Builder::new()
/// .status(200)
/// .url(Url::parse("http://example.com")?)
/// .body(())?;
///
/// # Ok(())
/// # }
fn url(&mut self, url: Url) -> &mut Self;
}