Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

saaj/tornado-httpclient-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

Session support to tornado.httpclient.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages