httpclient

package module
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 2 Imported by: 1

README

httpclient

Wrappers for HTTP client operations

  • Logging requests via a pluggable logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlledRedirectClient added in v0.0.6

type ControlledRedirectClient interface {
	HttpClient
	SetCheckRedirect(func(req *http.Request, via []*http.Request) error)
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HttpClient indicates the core function in http.Client, allowing features to be nested easily.

var DefaultClient HttpClient = &http.Client{}

DefaultClient is the http.Client zero-valued default.

type WithFinalNewline added in v0.1.0

type WithFinalNewline struct {
	W io.Writer
	// contains filtered or unexported fields
}

WithFinalNewline adds a final newline to a written stream of bytes. This is intended for textual content sent via HTTP, for which the trailing newline is an often-forgotten Posix requirement. Wrap an existing Writer, then call EnsureFinalNewline after all the content has been written through.

func (*WithFinalNewline) EnsureFinalNewline added in v0.1.0

func (d *WithFinalNewline) EnsureFinalNewline() error

func (*WithFinalNewline) Write added in v0.1.0

func (d *WithFinalNewline) Write(p []byte) (n int, err error)

Directories

Path Synopsis
Package body provides a buffering utility allowing HTTP request and response bodies to be buffered so they can be read multiple times.
Package body provides a buffering utility allowing HTTP request and response bodies to be buffered so they can be read multiple times.
Package hostheader provides a HttpClient wrapper that automatically inserts the Host header into the requests it makes.
Package hostheader provides a HttpClient wrapper that automatically inserts the Host header into the requests it makes.
Package mime implements parts of the MIME spec similarly to the standard "mime" package.
Package mime implements parts of the MIME spec similarly to the standard "mime" package.
Package prefix provides fixed prefixing for HTTP client requests.
Package prefix provides fixed prefixing for HTTP client requests.
Package testhttpclient provides a tool for testing code that uses HTTP client(s).
Package testhttpclient provides a tool for testing code that uses HTTP client(s).

Jump to

Keyboard shortcuts

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