http icon indicating copy to clipboard operation
http copied to clipboard

HTTP::Session

Open tarcieri opened this issue 9 years ago • 1 comments

Many other HTTP libraries provide a session abstraction as a way of carrying state (i.e. cookies) between requests, potentially across different origins (e.g. following redirects).

http://docs.python-requests.org/en/master/user/advanced/#session-objects

I think this is the best way to solve #302 (cc @zanker)

tarcieri avatar Feb 16 '16 00:02 tarcieri

I that the session objects might allow us to make HTTP::Client thread-safe (see https://github.com/socketry/async-io/issues/17). Currently I would not expect that HTTP::Client caches the @connection object without looking at it; and I still assumed that it's not, even though I'm very familiar with http.rb codebase by now. But with session objects it would be obvious that the HTTP::Client is (hopefully) immutable, while HTTP::Session uses the same connection.

janko avatar Nov 18 '18 09:11 janko