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

Method bytes

src/client/blocking/response/http.rs:128–138  ·  view source on GitHub ↗

Returns the bytes content of the response.

(&self, py: Python)

Source from the content-addressed store, hash-verified

126
127 /// Returns the bytes content of the response.
128 pub fn bytes(&self, py: Python) -> PyResult<Py<PyAny>> {
129 py.allow_threads(|| {
130 let resp = self.0.inner()?;
131 let buffer = pyo3_async_runtimes::tokio::get_runtime()
132 .block_on(resp.bytes())
133 .map(BytesBuffer::new)
134 .map_err(Error::Request)?;
135
136 Python::with_gil(|py| buffer.into_bytes(py))
137 })
138 }
139
140 /// Convert the response into a `Stream` of `Bytes` from the body.
141 pub fn stream(&self, py: Python) -> PyResult<BlockingStreamer> {

Callers 4

session_get_testFunction · 0.45
non_session_get_testFunction · 0.45
agetFunction · 0.45
test_get_bytesFunction · 0.45

Calls 2

innerMethod · 0.80
into_bytesMethod · 0.80

Tested by 1

test_get_bytesFunction · 0.36