httpx2

(github.com)

48 points by tosh4 hours ago

7 comments

  • jenders1 hour ago
    I would been pleased to see this project named something else, maybe “httpx-ng” or “httpy” as I immediately link “http*2” with the obsolete http/2 protocol and not the httpx project.
    • chrisweekly1 hour ago
      By what definition is HTTP&#x2F;2 considered obsolete? Are you suggesting it&#x27;s been supplanted by H3?<p>(FWIW I agree w&#x2F; your objection to the &quot;httpx2&quot; name.)
    • auvi15 minutes ago
      Ruby has httparty. <a href="https:&#x2F;&#x2F;github.com&#x2F;jnunemaker&#x2F;httparty" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jnunemaker&#x2F;httparty</a>
    • theanonymousone1 hour ago
      httpy is actually twofold cool for a Python HTTP client!
    • brainzap1 hour ago
      I agree, the brain built in error correction makes it harder to read
  • BoumTAC1 hour ago
    Noob question: what&#x27;s the purpose of having so many request libraries? In JavaScript it&#x27;s crazy, but in Python it&#x27;s starting to feel the same: requests, httpx, httpx2...<p>From my perspective, HTTP requests have been mastered for years (decades?). What&#x27;s the point of switching libraries? What&#x27;s so extraordinary about the <i>new</i> HTTP library that makes requests look crap?<p>I understand that new protocols appear from time to time (like HTTP&#x2F;2), but that&#x27;s very rare. And if there are performance differences between two libraries, are they really that huge? Even if they are, 99% of people don&#x27;t need that boost. What prevents someone from just improving the existing library&#x27;s performance?
    • t098i356 minutes ago
      `requests` has a friendlier API than the standard library. However, it does not support newer versions of HTTP, nor does it support `async`. The maintainer considers it complete, feature-frozen software, IIRC - they&#x27;d rather keep it stable for existing users and let other libraries succeed it.<p>`aiohttp` supports `async` but was never popular for non-async<p>`httpx` supported newer HTTP versions and both async and non-async. However the maintainer decided to close all outside submissions, issues and discussions for personal reasons.<p>`httpx2` is a maintained fork of `httpx`
      • BoumTAC51 minutes ago
        Thanks for the explanation !
    • lucideer9 minutes ago
      HTTP is a pretty complex space once you get into the nitty-gritty of use-cases, common request handling patterns &amp; conditional&#x2F;dynamic header-definitions. In general this leads to:<p>- (a) built-ins (&amp; some libraries) being very verbose to use because they tend to take a &quot;fundamentals of HTTP&quot; approach &amp; not implement shortcuts&#x2F;common patterns<p>- (b) libraries commonly falling into the trap of going the opposite direction &amp; ending up with massive scope-creep and&#x2F;or oversimplified, un-expressive APIs.<p>This leads to a churn of libraries due to developers yearning for a Goldilocks implementation in between.<p>Javascript tends to be ahead of other ecosystems in churn due to ease of library publishing, Python&#x27;s catching up, but overall it&#x27;s the same pattern in both.<p>---<p>Also, one big additional factor is async:<p>- NodeJS built-ins implemented a callback pattern just before promises took off, &amp; have struggled to upgrade to promises cleanly without breaking backward compat.<p>- Python&#x27;s got a similar story with various generations of http library being sync, or relying on different async approaches in confusing ways.
    • globular-toast41 minutes ago
      There can be different APIs or different technical implementations with certain performance characteristics. In this case, there isn&#x27;t any purpose, though. It&#x27;s just that development has slowed or stopped on the previous libraries and forking&#x2F;renaming is easier than trying to continue the previous projects, for various reasons.
  • casper141 hour ago
    People should be aware how much worse HTTPX performs versus Aiohttp. For high scale systems it makes a massive difference
    • nateb20221 hour ago
      pyreqwest has been delightful so far: <a href="https:&#x2F;&#x2F;github.com&#x2F;MarkusSintonen&#x2F;pyreqwest" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MarkusSintonen&#x2F;pyreqwest</a><p>It&#x27;s been a pleasure to use, has a httpx compatibility layer, and it&#x27;s fast (<a href="https:&#x2F;&#x2F;github.com&#x2F;MarkusSintonen&#x2F;pyreqwest&#x2F;blob&#x2F;main&#x2F;docs&#x2F;benchmarks.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MarkusSintonen&#x2F;pyreqwest&#x2F;blob&#x2F;main&#x2F;docs&#x2F;b...</a>)
    • NewJazz1 hour ago
      AIUI the fork has better performance.
    • qurren1 hour ago
      I keep confusing aiortc and aoc
    • ranger_danger37 minutes ago
      I searched and searched for way too long and could not find <i>any</i> information on whether or not aiohttp supports HTTP&#x2F;2 or 3... do you know or have any reference that explains what all is supported?
  • WalterGR2 hours ago
    Also see the user’s other submission <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49477212">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49477212</a><p>“OpenAI: Migrating to HTTPX2” (github.com&#x2F;openai)<p>66 points | 1 hour ago | 50 comments
  • vivzkestrel52 minutes ago
    aiohttp vs httpx2?
    • WalterGR10 minutes ago
      <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49478655">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49478655</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49479566">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49479566</a>
  • igkougkousis22 minutes ago
    [flagged]