httpclient

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(baseURL, resource string, defaultPort int, options ...Option) (*url.URL, *http.Client, error)

New creates a base URL and a new http.Client. The default port is only used if baseURL does not contain a port.

func ReadError

func ReadError(status int, body []byte) error

func ReadErrorFrom

func ReadErrorFrom(status int, r io.Reader) error

Types

type Option

type Option func(*clientConfig) error

Option is the option type for httpclient

func Timeout

func Timeout(timeout time.Duration) Option

Timeout configures the timeout to wait for a response

Jump to

Keyboard shortcuts

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