Skip to main content

Requests that supports HTTP/1.1 and HTTP/2

Project description

requests-h2

Requests that supports HTTP/1.1 and HTTP/2.

It may help people who want requests-style coding to send HTTP2 requests and don't want to upgrade their OpenSSL version, and it allows you to send HTTP/1.1 and HTTP/2 requests extremely easily.

requests-h2是一个支持http2的http请求库,本项目基于requests与httpcore,除增加了额外参数外,与requests使用方法一致。

You use it just like requests:

>>> import requests-h2 as requests
>>> r = requests.get('https://www.google.com', http2=True)
>>> r.status_code
200
>>> r.version
'HTTP/2'

Installation

You can install requests-h2 either via the Python Package Index (PyPI) or from source.

To install using pip:

pip install requests-h2

Requirements

Python 3.7+

Dependencies

  • requests
  • httpcore
  • urllib3<2

Motivation

We are used to using requests to send HTTP requests, but it doesn't support HTTP2 util 2023 and maybe util now. Although there are some libraries which have already supported HTTP2,but it's hard for me to change dependencies,so i created this project to meet my demands. And the urllib3 which requests relies on is doing their effort to support HTTP2,but they need OpenSSL > 1.11,and anyone who don't want to upgrade it still can use this library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests-h2-0.1.1.tar.gz (18.6 kB view hashes)

Uploaded Source

Built Distribution

requests_h2-0.1.1-py2.py3-none-any.whl (19.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page