Use HTTP/2 instead of 1.1 · Issue #587 · hetznercloud/hcloud-python · GitHub
Skip to content

Use HTTP/2 instead of 1.1 #587

Open
Open

Description

@betelgeuse

Feature Request

Is your feature request related to a problem? Please describe.

Currently requests are done with HTTP 1.1:

>>> client.servers.get_all()
2025-11-11 13:25:32,402 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.hetzner.cloud:443
2025-11-11 13:25:32,630 - urllib3.connectionpool - DEBUG - https://api.hetzner.cloud:443 "GET /v1/servers?page=1&per_page=50 HTTP/1.1" 200 178

Describe the solution you'd like

The requests should use HTTP 2 for better performance as the servers do support it

$ curl -i https://api.hetzner.cloud
HTTP/2 404 

Describe alternatives you've considered

Staying with HTTP 1.1 and accepting worse performance.

Teachability, Documentation, Adoption, Migration Strategy

urllib3 underpinning requests does not support HTTP 2 so this requests switching the library.

https://github.com/urllib3/urllib3/milestone/10

Here httpx is suggested as an alternative. Would it be acceptable?

https://webscraping.ai/faq/urllib3/can-i-use-urllib3-with-http-2-protocol

Activity

  1. changed the title [-]Use HTTP 2 instead of 1.1[/-] [+]Use HTTP/2 instead of 1.1[/+] on Nov 11, 2025
  2. jooola commented on Nov 11, 2025

    @jooola
    Member

    Is that an actual problem for your usage of the SDK?

  3. betelgeuse commented on Nov 11, 2025

    @betelgeuse
    Author

    Is that an actual problem for your usage of the SDK?

    My experience with https://github.com/ansible-collections/hetzner.hcloud has been rather slow performance so I started thinking about improvements to the stack. However, I haven't done proper research whether HTTP/2 would make a difference. It would make sense though that things like multiplexing pagination would be useful.

  4. koval01 commented on May 23, 2026

    @koval01

    I don't think switching to HTTP/2 makes sense for this library.

    Switching from requests to httpx (the only real way to get full HTTP/2 support) would require significant code rework, the introduction of global session management, and would complicate cleanup, threading, and asynchronous usage, as well as increase the maintenance burden. For typical hcloud-python usage—primarily sequential calls, server creation, and polling for actions—the real benefits of multiplexing and header compression would be negligible.
    The complexity and likelihood of introducing new issues significantly outweigh any potential performance gains. I would suggest closing this issue as “will not be fixed” or “very low priority.”

    If we really want to go down this road, we could also switch to curl_cffi for HTTP/3, but at that point we're just doing tech fashion, not solving real problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions