httpx

package
v0.0.2-testing Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpx builds HTTP clients with authentication, retries, a User-Agent and optional debug tracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(o Options) *http.Client

Types

type Options

type Options struct {
	// TokenSource authenticates requests (optional).
	TokenSource TokenSource
	UserAgent   string
	// Debug receives a request/response trace when non-nil.
	Debug io.Writer
	// MaxRetries for idempotent requests on 429/5xx (default 2).
	MaxRetries int
	Base       http.RoundTripper
}

type TokenSource

type TokenSource interface {
	oauth2.TokenSource
	// Invalidate discards the current token and reports whether the next
	// Token call can return a different one (false for static tokens).
	Invalidate() bool
}

TokenSource is an oauth2.TokenSource that can be told its token was rejected.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL