Help us shape the future of Go! Take the 2026 Go Developer Survey

httpclient

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package httpclient builds outbound HTTP clients that own their transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(timeout time.Duration) *http.Client

New returns a client with its own transport and the given timeout. Create it once per backend and reuse it so connections are pooled.

func NewTransport

func NewTransport() *http.Transport

NewTransport returns a clone of http.DefaultTransport that no other client shares, so CloseIdleConnections on the default transport (httptest.Server.Close) cannot reach it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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