| 107 | /// Make a rqeuest with the specified method and URL. |
| 108 | #[pyo3(signature = (method, url, **kwds))] |
| 109 | pub fn request( |
| 110 | &self, |
| 111 | py: Python, |
| 112 | method: Method, |
| 113 | url: PyBackedStr, |
| 114 | kwds: Option<RequestParams>, |
| 115 | ) -> PyResult<BlockingResponse> { |
| 116 | py.allow_threads(|| { |
| 117 | let client = self.0.clone(); |
| 118 | pyo3_async_runtimes::tokio::get_runtime() |
| 119 | .block_on(execute_request(client, method, url, kwds)) |
| 120 | .map(Into::into) |
| 121 | }) |
| 122 | } |
| 123 | |
| 124 | /// Make a WebSocket request to the specified URL. |
| 125 | #[pyo3(signature = (url, **kwds))] |