httpclient

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 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.

Jump to

Keyboard shortcuts

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