MCPcopy Create free account
hub / github.com/apify/crawlee-python / send_request

Method send_request

src/crawlee/http_clients/_base.py:128–157  ·  view source on GitHub ↗

Send an HTTP request via the client. This method is called from `context.send_request()` helper. Args: url: The URL to send the request to. method: The HTTP method to use. headers: The headers to include in the request. payload: The d

(
        self,
        url: str,
        *,
        method: HttpMethod = 'GET',
        headers: HttpHeaders | dict[str, str] | None = None,
        payload: HttpPayload | None = None,
        session: Session | None = None,
        proxy_info: ProxyInfo | None = None,
        timeout: timedelta | None = None,
    )

Source from the content-addressed store, hash-verified

126
127 @abstractmethod
128 async def send_request(
129 self,
130 url: str,
131 *,
132 method: HttpMethod = 'GET',
133 headers: HttpHeaders | dict[str, str] | None = None,
134 payload: HttpPayload | None = None,
135 session: Session | None = None,
136 proxy_info: ProxyInfo | None = None,
137 timeout: timedelta | None = None,
138 ) -> HttpResponse:
139 """Send an HTTP request via the client.
140
141 This method is called from `context.send_request()` helper.
142
143 Args:
144 url: The URL to send the request to.
145 method: The HTTP method to use.
146 headers: The headers to include in the request.
147 payload: The data to be sent as the request body.
148 session: The session associated with the request.
149 proxy_info: The information about the proxy to be used.
150 timeout: Maximum time allowed to process the request.
151
152 Raises:
153 ProxyError: Raised if a proxy-related error occurs.
154
155 Returns:
156 The HTTP response received from the server.
157 """
158
159 @abstractmethod
160 def stream(

Calls

no outgoing calls