Returns the text content of the response.
(&self, py: Python)
| 93 | |
| 94 | /// Returns the text content of the response. |
| 95 | pub fn text(&self, py: Python) -> PyResult<String> { |
| 96 | py.allow_threads(|| { |
| 97 | let resp = self.0.inner()?; |
| 98 | pyo3_async_runtimes::tokio::get_runtime() |
| 99 | .block_on(resp.text()) |
| 100 | .map_err(Error::Request) |
| 101 | .map_err(Into::into) |
| 102 | }) |
| 103 | } |
| 104 | |
| 105 | /// Returns the text content of the response with a specific charset. |
| 106 | pub fn text_with_charset(&self, py: Python, encoding: PyBackedStr) -> PyResult<String> { |