I've spent a few hours too much today trying to get Python requests + hyper working.
I've managed to log onto the drupal site (need to automate some things), but it seems that due to HTTP2 only used on the server, and hyper not being at mature level - it simply does not work.
First request (loging in) works fine, but session variable remains empty, and every subsequent request fails.
I'm reading my payload from Yaml, and as mentioned, logging in and first request works fine.
payloadadmin:
form_id : "user_login"
name : "Igor"
pass : "blah"
remember_me : "1"
op: "Log in"
def site_login():
s = requests.session()
s.mount('https://my.site.com', HTTP20Adapter())
headers = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36'}
r = s.post(URL, headers=headers, data=payload, allow_redirects=False, verify=True)
return s
main:
s = site_login(conf['payloadadmin'],'https://my.site.com/user')
r = s.get('https://my.site.com/admin/export/csv')