Created
August 18, 2020 13:56
-
-
Save takwas/97ca31f829fb24887f07b56046d1f219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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