3 ms·
`post` automatically releases the connection. `with` only makes sense when you use a `requests.Session()`.
by KTibow 1y ago
`post` automatically releases the connection. `with` only makes sense when you use a `requests.Session()`.
- threeducks 1y agoYou are right! https://github.com/psf/requests/blob/c65c780849563c891f35ffc98d3198b71011c012/src/requests/api.py#L58 https://github.com/psf/requests/blob/c65c780849563c891f35ffc... The post function calls request the request function which uses its own context manager that will call the close function of the connection object.