Registry / http-client / puerkitobio-rehttp

puerkitobio-rehttp

JSON →
library1.4.0gogounverified

Package rehttp implements an HTTP transport that handles retries with configurable strategies.

go get github.com/PuerkitoBio/rehttp
INSTALL
IMPORT
SIG · PUERKITOBIO-REHTTP
P
puerkitobio-rehttp
http-clientgov1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rehttp
github.com/PuerkitoBio/rehttp

Creates an HTTP client with retry logic for temporary errors.

package main import ( "net/http" "github.com/PuerkitoBio/rehttp" ) func main() { tr := rehttp.NewTransport( http.DefaultTransport, rehttp.RetryAll(rehttp.RetryMaxRetries(3), rehttp.RetryAny(rehttp.RetryTemporaryErr())), rehttp.ConstDelay(0), ) client := &http.Client{Transport: tr} client.Get("http://example.com") }
Debug
Known issues
gotchaBody buffering may cause high memory usage for large requests.
fix
Set PreventRetryWithBody to true to disable retries for requests with bodies.
affects: <1.4.0
Upgrade
Version history
1.4.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Amazon
1
Resources
puerkitobio-rehttp — go get puerkitobio-rehttp · libregistry