Skip to content

HTTPClient v2.1.0

Choose a tag to compare

@cmilesio cmilesio released this 17 Oct 14:51
43fad7d

HTTPX v2.1.0 adds generic client methods, fixes decoding for named raw response types, and updates HTTP compression and network security dependencies.

Generic client methods

Call typed request helpers directly on a client. Existing package functions remain available.

client := httpx.New()
user, err := client.Get[User]("https://api.example.com/users/1")

The method helpers cover all supported HTTP verbs, including their context variants. See #10.

Fixes

  • Named strings and byte slices now decode without panicking through package helpers, client methods, and Do. Thanks to @bensynapse for #16.
  • Updated klauspost/compress to v1.20.2 and golang.org/x/net to v0.61.0, along with crypto, sys, and text updates. See #20.
  • Updated the underlying req/v3 client to v3.61.0 and included the dependency security updates from #11.

Go version

Requires Go 1.27 or newer, increased from Go 1.24.4 in v2.0.1 to support generic client methods. Upgrade your local and CI toolchains before updating. Consumers remaining on older Go versions should stay on v2.0.1.

Upgrade

go get github.com/goforj/httpx/v2@v2.1.0

Full changes: goforj/httpx@v2.0.1...v2.1.0

This snapshot preserves the original Httpx history. For the installable HTTPClient module, see HTTPClient v0.1.0.