Update 2016-06-14: tornado-httpclient-session has vanished from PyPi. This is a fork of Saaj, with the cached data from the official PyPi package merged for backwards compatibility. From the original metadata:
Metadata-Version: 2.0
Name: tornado-httpclient-session
Version: 0.2.1
Summary: Session support to tornado.httpclient.
Home-page: https://github.com/mailto1587/tornado-httpclient-session
Author: mailto1587
Author-email: [email protected]
License: http://opensource.org/licenses/MIT
Keywords: Tornado,HttpClient,Session
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Requires-Dist: tornado
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!
pip install tornado-httpclient-session
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 attachedpython setup.py test
Or for all supported environments:
tox
Persistences of:
- Cookies ✔
- Referrer ✘
- Authorization ✘