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

hyper.contrib.HTTP20Adapter with requests.session not working on python 2.7 #419

Open
ramazk opened this issue Oct 3, 2019 · 0 comments

Comments

@ramazk
Copy link

ramazk commented Oct 3, 2019

Python 2.7.10 (default, Oct  6 2017, 22:29:07) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> from hyper.contrib import HTTP20Adapter
>>> s = requests.Session()
>>> s.mount('https://http2.pro', HTTP20Adapter())
>>> s.get('https://http2.pro/api/v1').json()
{u'push': 0, u'protocol': u'HTTP/1.1', u'user_agent': u'python-requests/2.22.0', u'http2': 0}

On python3 same code shows:
{'http2': 1, 'protocol': 'HTTP/2.0', 'push': 0, 'user_agent': 'python-requests/2.22.0'}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant