https://github.com/mosquito/rest-client
RESTFull client library for python (based on tornado)
https://github.com/mosquito/rest-client
async-python http-client tornado
Last synced: 9 months ago
JSON representation
RESTFull client library for python (based on tornado)
- Host: GitHub
- URL: https://github.com/mosquito/rest-client
- Owner: mosquito
- License: mit
- Created: 2015-11-03T09:17:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T11:55:20.000Z (almost 9 years ago)
- Last Synced: 2025-03-23T19:22:26.098Z (9 months ago)
- Topics: async-python, http-client, tornado
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
rest-client
===========
.. image:: https://travis-ci.org/mosquito/rest-client.svg
:target: https://travis-ci.org/mosquito/rest-client
.. image:: https://img.shields.io/pypi/v/rest-client.svg
:target: https://pypi.python.org/pypi/rest-client/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/wheel/rest-client.svg
:target: https://pypi.python.org/pypi/rest-client/
.. image:: https://img.shields.io/pypi/pyversions/rest-client.svg
:target: https://pypi.python.org/pypi/rest-client/
.. image:: https://img.shields.io/pypi/l/rest-client.svg
:target: https://pypi.python.org/pypi/rest-client/
RESTful Client for tornado with support cookies.
Example::
# encoding: utf-8
from tornado.ioloop import IOLoop
from tornado.gen import coroutine, Return
from rest_client.async import RESTClient
io_loop = IOLoop.current()
@coroutine
def repo_list():
client = RESTClient(headers={'User-Agent': 'curl/7.43.0'})
# check api
yield client.get('https://api.github.com/users/octocat/orgs')
response = yield client.get('https://api.github.com/repos/vmg/redcarpet/issues?state=closed')
data = sum(map(lambda x: x.comments, response.body))
print('Total comments: {0}'.format(data))
exit(io_loop.run_sync(repo_list))