MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / new

Method new

src/client/async_impl/response/http.rs:31–41  ·  view source on GitHub ↗

Create a new `Response` instance.

(mut response: wreq::Response)

Source from the content-addressed store, hash-verified

29impl Response {
30 /// Create a new `Response` instance.
31 pub fn new(mut response: wreq::Response) -> Self {
32 Response {
33 url: response.url().clone(),
34 version: Version::from_ffi(response.version()),
35 status_code: StatusCode::from(response.status()),
36 remote_addr: response.remote_addr().map(SocketAddr),
37 content_length: response.content_length(),
38 headers: HeaderMap(std::mem::take(response.headers_mut())),
39 response: ArcSwapOption::from_pointee(response),
40 }
41 }
42
43 /// Consumes the `Response` and returns the inner `wreq::Response`.
44 pub fn inner(&self) -> PyResult<wreq::Response> {

Callers

nothing calls this directly

Calls 7

HeaderMapClass · 0.85
StreamerClass · 0.85
urlMethod · 0.45
versionMethod · 0.45
statusMethod · 0.45
remote_addrMethod · 0.45
content_lengthMethod · 0.45

Tested by

no test coverage detected