MCPcopy
hub / github.com/tornadoweb/tornado / fetch

Method fetch

tornado/httpclient.py:122–137  ·  view source on GitHub ↗

Executes a request, returning an `HTTPResponse`. The request may be either a string URL or an `HTTPRequest` object. If it is a string, we construct an `HTTPRequest` using any additional kwargs: ``HTTPRequest(request, **kwargs)`` If an error occurs during the fetch,

(
        self, request: Union["HTTPRequest", str], **kwargs: Any
    )

Source from the content-addressed store, hash-verified

120 self._closed = True
121
122 def fetch(
123 self, request: Union["HTTPRequest", str], **kwargs: Any
124 ) -> "HTTPResponse":
125 """Executes a request, returning an `HTTPResponse`.
126
127 The request may be either a string URL or an `HTTPRequest` object.
128 If it is a string, we construct an `HTTPRequest` using any additional
129 kwargs: ``HTTPRequest(request, **kwargs)``
130
131 If an error occurs during the fetch, we raise an `HTTPError` unless
132 the ``raise_error`` keyword argument is set to False.
133 """
134 response = self._io_loop.run_sync(
135 functools.partial(self._async_client.fetch, request, **kwargs)
136 )
137 return response
138
139
140class AsyncHTTPClient(Configurable):

Callers 12

mainFunction · 0.95
authorize_redirectMethod · 0.45
oauth2_requestMethod · 0.45
authenticate_redirectMethod · 0.45
twitter_requestMethod · 0.45
finishMethod · 0.45
mainFunction · 0.45
get_links_from_urlFunction · 0.45

Calls 1

run_syncMethod · 0.80

Tested by

no test coverage detected