human_curl icon indicating copy to clipboard operation
human_curl copied to clipboard

Context managers

Open Lispython opened this issue 14 years ago • 1 comments

Need add context manager to store session on one closure/namespace with sharing data between mathods calls

Example

 with human_curl as hurl:
     r1 = hurl.get("http://google.com")
     r2 = hurl.get("http://yandex.com")

or

 headers = dict(...)
 with human_curl(proxy=("127.0.0.1",8080), headers=headers) as hurl:
     # all human_curl arguments give into methods
     r1 = hurl.get("http://google.com")
     r2 = hurl.get("http://yandex.com")

Lispython avatar Sep 05 '11 09:09 Lispython

This could mimick requests.Session.

honzajavorek avatar Sep 16 '13 09:09 honzajavorek