Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

How to https? #408

Description

@peterbe

Consider

from hyper import HTTPConnection
c = HTTPConnection('www.peterbe.com')
c.request('GET', '/')
resp = c.get_response()
print(resp.status)
print(resp.headers['location'])

Output becomes:

301
[b'https://www.peterbe.com/']

That's like doing curl -v http://www.peterbe.com which will also respond with:

< HTTP/1.1 301 Moved Permanently
< Server: cloudflare-nginx
< Date: Wed, 24 Apr 2019 13:32:25 GMT
< Content-Type: text/html
< Content-Length: 162
< Connection: keep-alive
< Location: https://www.peterbe.com/

I think the problem is that http://www.peterbecom is HTTP/1.1 whereas https://www.peterbe.com is HTTP/2. ...if that matters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions