Issue a new request via the configured proxy.
(
self,
method: bytes,
uri: bytes,
headers: TxHeaders | None = None,
bodyProducer: IBodyProducer | None = None,
)
| 360 | self._proxyURI: URI = URI.fromBytes(proxyURI) |
| 361 | |
| 362 | def request( |
| 363 | self, |
| 364 | method: bytes, |
| 365 | uri: bytes, |
| 366 | headers: TxHeaders | None = None, |
| 367 | bodyProducer: IBodyProducer | None = None, |
| 368 | ) -> Deferred[IResponse]: |
| 369 | """ |
| 370 | Issue a new request via the configured proxy. |
| 371 | """ |
| 372 | # Cache *all* connections under the same key, since we are only |
| 373 | # connecting to a single destination, the proxy: |
| 374 | return self._requestWithEndpoint( |
| 375 | key=(b"http-proxy", self._proxyURI.host, self._proxyURI.port), |
| 376 | endpoint=self._getEndpoint(self._proxyURI), # type: ignore[no-untyped-call] |
| 377 | method=method, |
| 378 | parsedURI=URI.fromBytes(uri), |
| 379 | headers=headers, |
| 380 | bodyProducer=bodyProducer, |
| 381 | requestPath=uri, |
| 382 | ) |
| 383 | |
| 384 | |
| 385 | class _ScrapyAgent: |
no test coverage detected