HTTP client for parallel http requests
Project description
tclient: HTTP client for parallel http requests
=========================
TClient is an http client for doing http requests in parallel. This is really just
a light wrapper around Tornado and uses Tornado's ioloop and httpclient.
Features
--------
* Create multiple HTTP requests, have them run in parallel.
* Convinient API for building requests with query params, forms, or JSON.
* Integrates with BlueOx for logging and metrics.
* Testing hooks
Use
---
`tclient.Request` is based on `tornado.httpclient.HTTPRequest`, so you should checkout
it's [documentation](http://www.tornadoweb.org/en/stable/httpclient.html#request-objects)
In summary:
req1 = tclient.Request('http://localhost:8888')
req1.params['search'] = 'turtles in a half-shell'
req2 = tclient.Request('http://localhost:8888')
req2.method = "POST"
req2.body = {'name': 'Raphael'}
req3 = tclient.Request('http://localhost:8888', method="POST")
req3.form['name'] = 'Raphael'
req3.form.add_file("tmnt.jpg", picture_fp)
resp1, resp2, resp3 = tclient.fetch_all([req1, req2, req3], timeout=30)
for r in (resp1, resp2, resp3):
r.rethrow()
print resp1.json['results']
### Dependencies
* tornado
* urllib3 (just for form encoding)
* pycurl (recommended)
* blueox (optional)
=========================
TClient is an http client for doing http requests in parallel. This is really just
a light wrapper around Tornado and uses Tornado's ioloop and httpclient.
Features
--------
* Create multiple HTTP requests, have them run in parallel.
* Convinient API for building requests with query params, forms, or JSON.
* Integrates with BlueOx for logging and metrics.
* Testing hooks
Use
---
`tclient.Request` is based on `tornado.httpclient.HTTPRequest`, so you should checkout
it's [documentation](http://www.tornadoweb.org/en/stable/httpclient.html#request-objects)
In summary:
req1 = tclient.Request('http://localhost:8888')
req1.params['search'] = 'turtles in a half-shell'
req2 = tclient.Request('http://localhost:8888')
req2.method = "POST"
req2.body = {'name': 'Raphael'}
req3 = tclient.Request('http://localhost:8888', method="POST")
req3.form['name'] = 'Raphael'
req3.form.add_file("tmnt.jpg", picture_fp)
resp1, resp2, resp3 = tclient.fetch_all([req1, req2, req3], timeout=30)
for r in (resp1, resp2, resp3):
r.rethrow()
print resp1.json['results']
### Dependencies
* tornado
* urllib3 (just for form encoding)
* pycurl (recommended)
* blueox (optional)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tclient-0.0.4.tar.gz
(6.7 kB
view details)
File details
Details for the file tclient-0.0.4.tar.gz.
File metadata
- Download URL: tclient-0.0.4.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f283f361ba537c1c64b611befd655037c52aa8c693988c6491c01e79c8a7da9
|
|
| MD5 |
792310e256c58cad0db85f6b08aab5fc
|
|
| BLAKE2b-256 |
5b22fa9e7f61f434611d75bd0d4883600084cd2d7d86539b59a70c1c5738af38
|