httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Version 1.0

Open tomchristie opened this issue 4 years ago • 54 comments

Update: Everything we need to consider ought to now be milestoned... https://github.com/encode/httpx/milestone/1


API Reference

Here's a high-level API reference...

Helper functions

request, stream, get, options, head, post, put, patch, delete

Clients

Client, AsyncClient

Models

Response, Request, URL, QueryParams, Headers, Cookies

Configuration

Limits, Proxy, Timeout

Authentication

Auth, BasicAuth, DigestAuth

Transports

ASGITransport, WSGITransport

Status Codes

codes


Exceptions

  • HTTPError
    • RequestError
      • TransportError
        • TimeoutException
          • ConnectTimeout
          • ReadTimeout
          • WriteTimeout
          • PoolTimeout
        • NetworkError
          • ConnectError
          • ReadError
          • WriteError
          • CloseError
        • ProtocolError
          • LocalProtocolError
          • RemoteProtocolError
        • UnsupportedProtocol
        • ProxyError
      • DecodingError
      • TooManyRedirects
    • HTTPStatusError
  • NotRedirectResponse
  • CookieConflict
  • StreamError
    • StreamConsumed
    • ResponseNotRead
    • RequestNotRead
    • ResponseClosed

Dependencies

  • httpcore
    • h11
    • sniffio
  • rfc3986
    • idna
  • certifi

Optionals: pip install httpx[http2], pip install httpx[brotli]

tomchristie avatar May 12 '20 15:05 tomchristie

I’d like to add a discussion point about our position wrt type hints would be. There’s been a couple of issues asking for them to be public API mainly for the use of third party library authors. I don’t have a strong position on this yet, but wondering if type hints (and more generally third party lib authoring experience, although that’s pretty broad) should be in our scope for 1.0?

florimondmanca avatar May 12 '20 16:05 florimondmanca

Good call yup, we need to discuss that for sure!

tomchristie avatar May 12 '20 16:05 tomchristie

We have a version 1.0 milestone. Should we formalize these points into issues and add them?

yeraydiazdiaz avatar May 13 '20 08:05 yeraydiazdiaz

The proxy DEFAULT_MODE discussion needs to be part of this too.

tomchristie avatar May 13 '20 09:05 tomchristie

@yeraydiazdiaz Sure thing, yup.

tomchristie avatar May 13 '20 09:05 tomchristie

Having recently used httpx, I was very surprised that there's no rate-limiting (requests per second, not just max connections) built in. This greatly reduces the utility of the async mode.

pikeas avatar May 13 '20 17:05 pikeas

Okay. Sure we can have a discussion about that, tho it's not strictly a 1.0 blocker.

tomchristie avatar May 14 '20 08:05 tomchristie

Something else to potentially consider for 1.0 that came to my mind: #302, aka dropping certifi in favor of the system defaults. I have a different approach in mind that what was originally suggested in the issue, will comment there to see if it makes sense.

florimondmanca avatar May 16 '20 19:05 florimondmanca

I've had my eyes on this repository for a while and it looks very promising. The only thing preventing me from using this library is the lack of support for socks5 proxies. Gotta have this for connecting to Tor. It's also a lot easier to spin up a socks proxy server than it is an http proxy server (in my opinion). There's already an open issue: #203. There's also a PR in httpcore: encode/httpcore#51. Would be nice to see this in a 1.0 release.

bwright1558 avatar May 16 '20 22:05 bwright1558

@bwright1558 From my POV, SOCKS proxy support is a nice-to-have, but technically not a blocker for 1.0 (we can probably add it later as an incremental new feature, without having to break any existing API).

Note that there's been loads of work by Yeray and @sethmlarson to pull off a sans-io implementation, and as you mentioned Yeray started the integration within httpcore (which is indeed almost only additive). If you'd like to help out I'm sure Yeray will appreciate early-stage user feedback there, e.g. see if the API makes sense, etc. :-)

florimondmanca avatar May 16 '20 22:05 florimondmanca

I agree with @florimondmanca in that SOCKS support is not a blocker for 1.0, though I certainly see it coming sooner rather than later 🤞

Personally I think the two most requested features for 1.0 are:

  • Built-in retries, for which Florimond already opened https://github.com/encode/httpx/pull/784)
  • Built-in throttling, which is partially addressed by the pool limits but has come up in the chat and Florimond suggested using https://github.com/florimondmanca/aiometer.

To me the latter feels more of a nice-to-have for 1.0, it could even be argued that it's better to leave it as a separate library completely.

yeraydiazdiaz avatar May 17 '20 07:05 yeraydiazdiaz

I think those are two interesting areas, but are they blockers for 1.0?

I’m still not super convinced we need to have retries built in (libraries like tenacity solve this problem brilliantly). But if we do want some basic functionality then I’d definitely make the case for making retries opt in (which makes it easier to bring in higher control via eg tenacity), in which case this would be a non breaking addition in all cases, so not a 1.0 blocker.

As for throttling, it seems we currently have expectations set wrong wrt pool limits. A lot of people seem to expect those to behave like throttling, when it’s really more about resource limiting. I guess we could address this with some docs revamp about pool limits (I remember Tom drafted a PR for this), and then perhaps recommend focused solutions like aiometer more prominently - at least as a first approach. (FWIW aiometer already has an HTTPX usage example in its README.) Like retries, I don’t see why we wouldn’t be able to bring this in incrementally (throttling should be opt in too), so not a 1.0 blocker in my mind.

florimondmanca avatar May 17 '20 08:05 florimondmanca

Probably not a strong argument, but retries are "built in" to Requests due to it relying on urllib3 for that, so adding it would allow a smoother transition from requests.

But, I will also concede it's not a requirement for meeting the HTTP client spec (aside from the Retry-After header being a thing...)

StephenBrown2 avatar May 18 '20 15:05 StephenBrown2

Not directly an httpx issue, but a heads-up that the httpx mock library RESPX doesn't yet support httpx 0.13:

  • https://github.com/lundberg/respx/pull/54

hugovk avatar May 23 '20 20:05 hugovk

So you're going to release 1.0 without socks v4/5 support? :-1:

P0oOOOo0YA avatar May 25 '20 20:05 P0oOOOo0YA

So you're going to release 1.0 without socks v4/5 support? 👎

Not acceptable. You need to rethink how you approach folks in the community - that’s a massively entitled and disrespectful way to approach your first interaction with a project.

Here’s a better approach:

Q: “Hi folks! Is socks v4/5 a priority? Does that come before or after 1.0?”

A: “1.0 is about API stability. Socks support might come either before or after that, but it’s not a blocker for us indicating that the project is API stable.”

tomchristie avatar May 25 '20 21:05 tomchristie

A: “1.0 is about API stability.

Hi folks! Sorry for not so well first impact but I think 1.0 is about minimum functionality as well. Maybe you're right and i'm a perfectionist to consider supporting proxies (both HTTP(s) & socks v4/5) the minimum requirement of an HTTP client. Anyway congratulations

P0oOOOo0YA avatar May 26 '20 17:05 P0oOOOo0YA

Not directly an httpx issue, but a heads-up that the httpx mock library RESPX doesn't yet support httpx 0.13:

The newly-released RESPX 0.11 now supports HTTPX 0.13 🎉

hugovk avatar May 29 '20 19:05 hugovk

Hello everyone, how is the 1.0 going 🙂 ? I would like to use HTTPX at work but my client requires software to be in a somewhat "stable" status, and the first note of the first page of the docs indicates that HTTPX should still be considered beta, so right now they won't have it.

Is there a way I could help you releasing version 1.0? Maybe start working on the issues in the 1.0 milestone? I'd appreciate some guidance as I didn't contribute to this project yet, and don't want to be a hindrance to the development 🙂 I'm also not particularly knowledgeable in HTTP protocol matters 😅 Let me know if there's anything I can help with 🙂

pawamoy avatar Aug 07 '20 09:08 pawamoy

Hi @pawamoy,

I understand that the currently advertised beta status could be a hindrance to spreading HTTPX in environments that require stability (I personally would like to start replacing Requests with HTTPX at work 😉), but for now that's how things are. HTTPX will will promoted to "stable" with 1.0.

I hope you'll understand that I'm personally sort of pushing back on asks like this since quality of design requires lots of careful thinking, and that means time. We shouldn't rush things.

So I personally can't even say when 1.0 will be. "Somewhere mid/late 2020" would be my fairest guess for now. We should be releasing 0.14 soon, and that's planned to be our last minor before 1.0.

If you'd like to help, yup, feel free to look over items marked for the 1.0 milestone, since those are required before reaching 1.0. In terms of guidance well, give yourself some time to navigate and understand the code at a high level, then dig deeper as you need. :-) Our contributing guide should help you get up and running as far as tooling and development workflow is concerned.

Cheers!

florimondmanca avatar Aug 07 '20 11:08 florimondmanca

@florimondmanca of course, I was not asking for a 1.0 release just for the sake of it, but rather if I could help to implement the things that are required for the 1.0 release. I totally understand the need for careful thinking, and I don't want you to rush things! Thanks for your answer, I'll then see what I can do :slightly_smiling_face:

pawamoy avatar Aug 07 '20 11:08 pawamoy

I do not have any requirement to use httpx at work, but I have been watching this project for some time and I must say I am really amazed by the amount of work, discussion and thought put into everything in it :heart: . I am sure the 1.0 release will be glorious :smiley: :rocket:

aalvrz avatar Dec 04 '20 16:12 aalvrz

Should we update the README.md to reflect new estimate for 1.0 release ?

nkitsaini avatar Jan 03 '21 05:01 nkitsaini

@nkitsaini "Some time in 2021"? I guess we could aim for that. 😄 Feel free to send a PR if you're up for it!

florimondmanca avatar Jan 03 '21 10:01 florimondmanca

I vote for SOCKS proxy support too! (aiohttp & requests support them ... if it's not here : I doubt that it can be used/useful in the pro world (others programs/tools will not switch to httpx without that (it's my case)) I say that, I say nothing ... I will continue to use aiohttp til httpx supports it ;-(

manatlan avatar May 20 '21 12:05 manatlan

I vote for SOCKS proxy support too! (aiohttp & requests support them ... if it's not here : I doubt that it can be used/useful in the pro world (others programs/tools will not switch to httpx without that (it's my case)) I say that, I say nothing ... I will continue to use aiohttp til httpx supports it ;-(

+1

emil45 avatar Jul 02 '21 12:07 emil45

I'm very keen on adding SOCK proxy support, and I have been looking at it as part of the revised httpcore work I'm doing. However, there's no need for us that work to block declaring our library as API stable, with a 1.0 release.

I've just raised two discussions, which I'm considering the final blockers for a 1.0 release...

  • https://github.com/encode/httpx/discussions/1783
  • https://github.com/encode/httpx/discussions/1785

tomchristie avatar Aug 05 '21 16:08 tomchristie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 20 '22 15:02 stale[bot]

Thanks @stale.

Brief synopsis here. I think we're actually basically API stable for 1.0. I've got a bit of work on dropping a couple of our package requirements.

For example see https://github.com/encode/httpx/discussions/2083 to drop charset-normalizer.

Plus we ought think about any particular docs we want to update prior to a 1.0. (Eg outlining our deprecation policy. Also see #1797)

tomchristie avatar Feb 21 '22 13:02 tomchristie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 25 '22 07:03 stale[bot]