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

Do you plan to http client? #236

Closed
wku opened this issue Jun 23, 2017 · 5 comments
Closed

Do you plan to http client? #236

wku opened this issue Jun 23, 2017 · 5 comments

Comments

@wku
Copy link

wku commented Jun 23, 2017

No description provided.

@Carreau
Copy link
Contributor

Carreau commented Jun 23, 2017

If I understand the question correctly the response is (as far as I can tell) : you need to use https://github.com/njsmith/h11 or https://github.com/python-hyper/hyper-h2 depending on wether you want to speak http 1.1 or 2.0. h11 and h2 are sans-io implementation of the protocol, so you can use them with trio/curio/asyncio/choose-you-async-framework. I would look at #105 as it is stated here there are sill some work to do to support TLS before starting working on an http client.

@njsmith
Copy link
Member

njsmith commented Jun 23, 2017

Building your own client out of h11 or h2 is not easy... they take care of the low-level bits of the HTTP protocol, but there's a lot more on top that a good client has to worry about.

We don't plan to ship a http client as a built-in feature in the trio package, but we certainly do plan to have external packages that trio programs can use to make http requests. One possibility would be to add trio support to asks.

TLS support was implemented in #107, so it's available in current trio master and will be available in trio version 0.2, when I get around to releasing that...

@njsmith
Copy link
Member

njsmith commented Jun 23, 2017

Closing this issue because I think it's answered, but if I'm wrong feel free to re-open.

@merrellb
Copy link

Earlier you suggested that urllib3 might be the best path to asynchronous http (#105). I am unfamiliar with asks but is it looking like a better path forward? I've also put in an issue with urllib3 trying to get a sense of where things stand (urllib3/urllib3#1228) regarding trio.

I do think this issue may warrant a mention in the documentation (I almost created third issue before finding the other two). I realize trio is aimed at a lower level functionality but HTTP requests are likely the first thing a lot of folks will want to do with trio and your fame with h11 may lead to expectations that there is a clear way to tie them together :-) Even if there is no clear answer yet, a brief mention may reduce the number of extraneous issues raised.

@njsmith
Copy link
Member

njsmith commented Jul 15, 2017

Basically :my impression is that asks is a plausible short-term solution (it exists, they're explicitly interested in trio support, could probably make it happen today (though it would need to depend on unreleased trio for ssl and async file support)), but in the long-term I'm dubious – there's a ton of fiddly details involved in implementing an async HTTP client, and it'd be much better to piggy-back on the excellent urllib3/requests maintainers instead of trying to reinvent all that.

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

No branches or pull requests

4 participants