MCPcopy
hub / github.com/scrapy/scrapy / request

Method request

scrapy/core/downloader/handlers/http11.py:362–382  ·  view source on GitHub ↗

Issue a new request via the configured proxy.

(
        self,
        method: bytes,
        uri: bytes,
        headers: TxHeaders | None = None,
        bodyProducer: IBodyProducer | None = None,
    )

Source from the content-addressed store, hash-verified

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
385class _ScrapyAgent:

Callers 2

download_requestMethod · 0.45
download_requestMethod · 0.45

Calls 2

_requestWithEndpointMethod · 0.80
_getEndpointMethod · 0.80

Tested by

no test coverage detected