1s = requests.Session()
2s.auth = ('user', 'pass')
3s.headers.update({'x-test': 'true'})
4
5# both 'x-test' and 'x-test2' are sent
6s.get('https://httpbin.org/headers', headers={'x-test2': 'true'})
7
1s = requests.Session()
2
3s.get('https://httpbin.org/cookies/set/sessioncookie/123456789')
4r = s.get('https://httpbin.org/cookies')
5
6print(r.text)
7# '{"cookies": {"sessioncookie": "123456789"}}'
8