Session support to tornado.httpclient.
Project description
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for tornado-httpclient-session-0.2.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 761fd19b24188cd47f48aa749060463af94db3342e1cb53f328b37b91b2d8b8b |
|
MD5 | d9a514f5bf216ae4ac84fa2327c10911 |
|
BLAKE2b-256 | cfb3614eaf28f80adbf13d69c9505a5053e190b9c5095017b058ed188ae7d9e8 |