Tornado 6.1 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • Twisted may be used with the classes in tornado Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And native coroutine: 14 Chapter 6. Documentation Tornado Documentation, Release 6.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 6.0 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • Twisted may be used with the classes in tornado Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 5.1 Documentation
the following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • Twisted may be used with the classes in tornado Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And native coroutine: 12 Chapter 5. Documentation Tornado Documentation, Release 5.1.1 from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.5 DocumentationThe following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.2 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 260 页 | 1.06 MB | 1 年前3
Tornado 6.4 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.3 Documentation
The following optional packages may be useful: • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • pycares is an alternative non-blocking DNS resolver Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And And here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 264 页 | 1.06 MB | 1 年前3
Tornado 4.5 Documentation
3 includes this package in the standard library. • pycurl is used by the optional tornado.curl_httpclient. Libcurl version 7.22 or higher is required. • Twisted may be used with the classes in tornado For example, tornado.httpclient in the default configuration blocks on DNS resolution but not on other network access (to mitigate this use ThreadedResolver or a tornado.curl_httpclient with a properly-configured Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And0 码力 | 222 页 | 833.04 KB | 1 年前3
共 245 条
- 1
- 2
- 3
- 4
- 5
- 6
- 25













