Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.11.0 #190

Merged
merged 12 commits into from
Sep 22, 2020
Merged

Version 0.11.0 #190

merged 12 commits into from
Sep 22, 2020

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Sep 21, 2020

0.11.0 (September 22nd, 2020)

The Transport API with 0.11.0 has a couple of significant changes.

Firstly we've moved changed the request interface in order to allow extensions, which will later enable us to support features
such as trailing headers, HTTP/2 server push, and CONNECT/Upgrade connections.

The interface changes from:

def request(method, url, headers, stream, timeout):
    return (http_version, status_code, reason, headers, stream)

To instead including an optional dictionary of extensions on the request and response:

def request(method, url, headers, stream, ext):
    return (status_code, headers, stream, ext)

Having an open-ended extensions point will allow us to add later support for various optional features, that wouldn't otherwise be supported without these API changes.

In particular:

  • Trailing headers support.
  • HTTP/2 Server Push
  • sendfile.
  • Exposing raw connection on CONNECT, Upgrade, HTTP/2 bi-di streaming.
  • Exposing debug information out of the API, including template name, template context.

Currently extensions are limited to:

  • request: timeout - Optional. Timeout dictionary.
  • response: http_version - Optional. Include the HTTP version used on the response.
  • response: reason - Optional. Include the reason phrase used on the response. Only valid with HTTP/1.*.

See encode/httpx#1274 (comment) for the history behind this.

Secondly, the async version of request is now namespaced as arequest.

This allows concrete transports to support both sync and async implementations on the same class.

Added

Changed

@tomchristie tomchristie changed the title Update Transport API Version 0.11.0 Sep 22, 2020
@tomchristie
Copy link
Member Author

Let's push on with this.

@tomchristie tomchristie merged commit 60f3475 into master Sep 22, 2020
@tomchristie tomchristie deleted the ext branch September 22, 2020 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant