Tornado – Blocking & Non-Blocking HTTP Client


Tornado provides tornado.httpclient that works as httpclient and can send blocking and non-blocking (async) http requests.

tornado.httpclient.HTTPClient

1. HTTPClient: This tornado client is typically used for testing web servers or simply making a HTTP request and receiving the response. An example implementation below

tornado.httpclient.AsyncHTTPClient

2. AsyncHTTPClient: httpclient.AsyncHTTPClient()  creates an instance of the class and that can be reused one per IO loop. Here’s an example implementation below

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s