tornado-httpclient-session

Session support to tornado.httpclient.


Keywords
Tornado, HttpClient, Session
License
MIT
Install
pip install tornado-httpclient-session==0.1.6

Documentation

Tornado-HttpClient-Session

A mimic inspired by the session feature in Requests, it adds support to Tornado that allows you to persist context such as cookies and other parameters across requests' fetching from tornado.httpclient.

THIS IS SESSION ABOUT CLIENT, NOT SERVER!

Installation

pip install tornado-httpclient-session

Usage

from tornado.httpclient import HTTPClient

from httpclient_session import Session

s = Session(HTTPClient) # AsyncHTTPClient default

r = s.fetch('https://github.com')
print(r.headers['set-cookie']) # Inspect cookies returnd from Github

r = s.fetch('https://github.com') # Fetching carrys cookies
print(r.request.headers['cookie']) # Inspect cookies attached

Testing

python setup.py test

Or for all supported environments:

tox

Development Progress

Persistences of:

  • Cookies ✔
  • Referrer ✘
  • Authorization ✘

Any Suggestions Welcome!