httpclient

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(baseURL, resource string, 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

func WithClient

func WithClient(c *http.Client) Option

WithClient allows creation of the http client using an underlying network round tripper / client

Jump to

Keyboard shortcuts

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