python-hyper / hyper

HTTP/2 for Python.
http://hyper.rtfd.org/en/latest/
MIT License
1.05k stars 191 forks source link

Authentication how-to needed #351

Open paul-hammant opened 6 years ago

paul-hammant commented 6 years ago

It is in the headers, I think, and needs to be passed with every request:

c = HTTP11Connection(ip, port)
hdrs = headers = {
    "Authorization": "Basic cCF1eDpqYXZhYzE=",
}
first = c.request('GET', url, headers=hdrs)

My initial guess was that I could pass it into the constructor of the connection