wreq 6.0.0-rc.29

An ergonomic Rust HTTP Client with TLS fingerprint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub use upgrade::Upgraded;
use wreq_proto::upgrade;

use super::response::Response;
use crate::Error;

impl Response {
    /// Consumes the [`Response`] and returns a future for a possible HTTP upgrade.
    #[inline]
    pub async fn upgrade(self) -> crate::Result<Upgraded> {
        upgrade::on(http::Response::from(self))
            .await
            .map_err(Error::upgrade)
    }
}