body_producer is not supported onĬurl_httpclient. The write function returns aįuture which can be used for flow control.īe specified. It should call the write function with newĭata as it becomes available. It is called with one argument, a write function, and should body_producer – Callable used for lazy/asynchronous request bodies.body – HTTP request body as a string (byte or unicode if unicode.headers ( HTTPHeaders or dict) – Additional HTTP headers to pass on the request.HTTPRequest ( url, method='GET', headers=None, body=None, auth_username=None, auth_password=None, auth_mode=None, connect_timeout=None, request_timeout=None, if_modified_since=None, follow_redirects=None, max_redirects=None, user_agent=None, use_gzip=None, network_interface=None, streaming_callback=None, header_callback=None, prepare_curl_callback=None, proxy_host=None, proxy_port=None, proxy_username=None, proxy_password=None, allow_nonstandard_methods=None, validate_cert=None, ca_certs=None, allow_ipv6=None, client_key=None, client_cert=None, body_producer=None, expect_100_continue=False, decompress_response=None, ssl_options=None ) ¶Īll parameters except url are optional. Request objects ¶ class tornado.httpclient. May be supported depending on the implementation class in use. Of simultaneous fetch() operations that canĮxecute in parallel on each IOLoop. Keyword argument max_clients determines the maximum number To the constructor of each subclass instance created. If additional keyword arguments are given, they will be passed This method may be called with either a class object or theįully-qualified name of such a class (or None to use the default, classmethod configure ( impl, **kwargs ) ¶Ĭonfigures the AsyncHTTPClient subclass to use.ĪsyncHTTPClient() actually creates an instance of a subclass. Instead, you must check the response’s error attribute orĬall its rethrow method. In the callback interface, HTTPError is not automatically raised. If a callback is given, it will be invoked with the HTTPResponse. Response will always be returned regardless of the response Instead, if raise_error is set to False, the (other errors may also be raised if the server could not beĬontacted). HTTPError if the request returned a non-200 response code This method returns a Future whose result is an If it is a string, we construct an HTTPRequest using any additional The request may be either a string URL or an HTTPRequest object. fetch ( request, callback=None, raise_error=True, **kwargs ) ¶Įxecutes a request, asynchronously returning an HTTPResponse. No other methods may be called on the AsyncHTTPClient afterĬlose(). IOLoop is also being closed, or the force_instance=TrueĪrgument was used when creating the AsyncHTTPClient. That AsyncHTTPClient objects are transparently reused.Ĭlose() is generally only necessary when either the This method is not needed in normal use due to the way close ( ) ¶ĭestroys this HTTP client, freeing any file descriptors used. 在 4.1 版更改: The io_loop argument is deprecated. To select curl_httpclient, call nfigure at startup: Recommended that your libcurl installation is built withĪsynchronous DNS resolver (threaded or c-ares), otherwise you mayĮncounter various problems with request timeouts (for more Currently the minimum supported version of libcurl isħ.21.1, and the minimum version of pycurl is 7.18.2. Recommended that you use a recent version of libcurl and Note that if you are using curl_httpclient, it is highly
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |