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

Method bytes

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

Returns the bytes content of the response.

(&self, py: Python<'py>)

Source from the content-addressed store, hash-verified

179
180 /// Returns the bytes content of the response.
181 pub fn bytes<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
182 let resp = self.inner()?;
183 future_into_py(py, async move {
184 let buffer = resp
185 .bytes()
186 .await
187 .map(BytesBuffer::new)
188 .map_err(Error::Request)?;
189 Python::with_gil(|py| buffer.into_bytes(py))
190 })
191 }
192
193 /// Convert the response into a `Stream` of `Bytes` from the body.
194 pub fn stream(&self, py: Python) -> PyResult<Streamer> {

Callers

nothing calls this directly

Calls 2

innerMethod · 0.80
into_bytesMethod · 0.80

Tested by

no test coverage detected