Documentation
¶
Overview ¶
Package httpx wraps net/http with a User-Agent and retry on 5xx/429 (honoring Retry-After). The client has no Timeout — use context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client adds a User-Agent and bounded retry on 5xx, 429, and network errors. Safe for concurrent use.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithBackoff ¶
WithBackoff overrides the initial retry delay (300ms). Backoff doubles between attempts unless the server sends Retry-After. Values less than or equal to zero fall back to the default.
func WithMaxAttempts ¶
WithMaxAttempts overrides the total attempt budget (3). Values less than 1 still perform a single request.
Click to show internal directories.
Click to hide internal directories.