Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tornado-httpclient-session-0.2.5.tar.gz (7.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page