Skip to content

Instantly share code, notes, and snippets.

@takwas
Created August 18, 2020 13:56
Show Gist options
  • Save takwas/97ca31f829fb24887f07b56046d1f219 to your computer and use it in GitHub Desktop.
Save takwas/97ca31f829fb24887f07b56046d1f219 to your computer and use it in GitHub Desktop.
import requests
class Req1:
def __init__(self):
self._session = requests.Session()
def do_req():
with self._session:
self._session.post(...)
class Req2:
def __init__(self):
self._session = requests.Session()
def do_req():
with requests.Session() as session:
session.post(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment