whataphttp

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Func

func Func(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

wrapping handler function, example : http.HandleFunc(func(http.ResponseWriter, *http.Request))

func HandlerFunc

func HandlerFunc(handler func(http.ResponseWriter, *http.Request)) http.HandlerFunc

wrapping type of http.HanderFunc, example : http.Handle(pattern, http.HandlerFunc)

func HttpGet added in v0.1.11

func HttpGet(ctx context.Context, url string) (*http.Response, error)

func HttpPost added in v0.1.11

func HttpPost(ctx context.Context, url string, contentType string, body io.Reader) (*http.Response, error)

func HttpPostForm added in v0.1.11

func HttpPostForm(ctx context.Context, url string, data url.Values) (*http.Response, error)

func NewRoundTrip

func NewRoundTrip(ctx context.Context, t http.RoundTripper) http.RoundTripper

Types

type WrapRoundTrip

type WrapRoundTrip struct {
	// contains filtered or unexported fields
}

func NewWrapRoundTrip added in v0.1.14

func NewWrapRoundTrip(ctx context.Context, t http.RoundTripper) *WrapRoundTrip

func (*WrapRoundTrip) RoundTrip

func (this *WrapRoundTrip) RoundTrip(req *http.Request) (res *http.Response, err error)

Jump to

Keyboard shortcuts

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