httpclient

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidURL         = errors.New("url is invalid")
	ErrorReadingRespBody    = errors.New("error reading response body")
	ErrorRequestFailed      = errors.New("error making request")
	ErrorRequestBodyInvalid = errors.New("failed to convert request body data to JSON")

	DefaultTimeout time.Duration //nolint:gochecknoglobals // ok
	Post           = "POST"      //nolint:gochecknoglobals // ok
	Delete         = "DELETE"    //nolint:gochecknoglobals // ok
	Get            = "GET"       //nolint:gochecknoglobals // ok
)

Functions

This section is empty.

Types

type Header map[string]string

Header is a type used to store header field name/value pairs when sending HTTPS requests.

type ReqResp

type ReqResp interface {
	HTTPreq() error

	CloseBody()
	RespBody() string
	ResponseCode() int
	// contains filtered or unexported methods
}

func NewReqResp

func NewReqResp(ctx context.Context, url *url.URL, method *string, body interface{}, header Header,
	timeout *time.Duration, logger logr.Logger, client *http.Client, transport http.RoundTripper) (ReqResp, error)

Jump to

Keyboard shortcuts

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