Go to file
Seth Michael Larson ba83e29aee Support client cert passwords, new TLS options (#118)
* Support client cert passwords, new TLS options

* Update test_config.py

* Switch to try-except for post_handshake_auth=True

SSLContext.post_handshake_auth raises AttributeError if the property is available but cannot be written to (needs OpenSSL 1.1.1+)

* Also try-except for hostname_checks_common_name=False

* Custom implementation of trustme.CA() that emits encrypted PKs

* lint

* Split name of test

* Updates from review comments

* Don't load default CAs yet
2019-07-16 10:08:57 +01:00
docs Support WSGI and ASGI apps. (#94) 2019-06-18 15:53:33 +01:00
http3 Support client cert passwords, new TLS options (#118) 2019-07-16 10:08:57 +01:00
scripts Minor tweaks in line with requests behavior (#110) 2019-07-03 10:33:38 +01:00
tests Support client cert passwords, new TLS options (#118) 2019-07-16 10:08:57 +01:00
.gitignore Initial commit 2019-04-04 13:27:55 +01:00
.travis.yml Close outstanding connections on pool.close() 2019-04-24 11:42:45 +01:00
LICENSE.md Initial commit 2019-04-04 13:27:55 +01:00
mkdocs.yml Support WSGI and ASGI apps. (#94) 2019-06-18 15:53:33 +01:00
README.md Tweak README 2019-06-18 16:02:18 +01:00
requirements.txt Support client cert passwords, new TLS options (#118) 2019-07-16 10:08:57 +01:00
setup.py Check for connection aliveness on pool re-acquiry (#111) 2019-07-08 15:57:29 +01:00

HTTP3

Build Status Coverage Package version

HTTP3 is a next-generation HTTP client for Python 3.

Note: This project should be considered as an "alpha" release. It is substantially API complete, but there are still some areas that need more work.


Let's get started...

>>> import http3
>>> r = http3.get('https://www.example.org/')
>>> r
<Response [200 OK]>
>>> r.status_code
200
>>> r.protocol
'HTTP/2'
>>> r.headers['content-type']
'text/html; charset=UTF-8'
>>> r.text
'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'

Features

HTTP3 builds on the well-established usability of requests, and gives you:

Plus all the standard features of requests...

  • International Domains and URLs
  • Keep-Alive & Connection Pooling
  • Sessions with Cookie Persistence
  • Browser-style SSL Verification
  • Basic/Digest Authentication (Digest is still TODO)
  • Elegant Key/Value Cookies
  • Automatic Decompression
  • Automatic Content Decoding
  • Unicode Response Bodies
  • Multipart File Uploads
  • HTTP(S) Proxy Support (TODO)
  • Connection Timeouts
  • Streaming Downloads
  • .netrc Support (TODO)
  • Chunked Requests

Installation

Install with pip:

$ pip install http3

HTTP3 requires Python 3.6+

Documentation

Project documentation is available at www.encode.io/http3/.

For a run-through of all the basics, head over to the QuickStart.

For more advanced topics, see the Advanced Usage section, or the specific topics on making Parallel Requests or using the Async Client.

The Developer Interface provides a comprehensive API reference.

Dependencies

The HTTP3 project relies on these excellent libraries:

  • h2 - HTTP/2 support.
  • h11 - HTTP/1.1 support.
  • certifi - SSL certificates.
  • chardet - Fallback auto-detection for response encoding.
  • idna - Internationalized domain name support.
  • rfc3986 - URL parsing & normalization.
  • brotlipy - Decoding for "brotli" compressed responses. (Optional)

A huge amount of credit is due to requests for the API layout that much of this work follows, as well as to urllib3 for plenty of design inspiration around the lower level networking details.

HTTP3 is BSD licensed code. Designed & built in Brighton, England.