httpclient

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpClient = &http.Client{
	Timeout: 10 * time.Minute,
}

Functions

func Call

func Call(method, url string, body io.Reader, funcClient func() *http.Client, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func CallWithContext

func CallWithContext(ctx context.Context, method, url string, body io.Reader, funcClient func() *http.Client, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func Http

func Http(method, url string, body io.Reader, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func HttpWithContext

func HttpWithContext(ctx context.Context, method, url string, body io.Reader, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func JSON

func JSON(url string, data interface{}, result interface{}, funcHeader func(header http.Header)) error

func POST

func POST(url string, data interface{}, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func PostForm

func PostForm(url string, data url.Values, funcHeader func(header http.Header), funcResponse func(response *http.Response) error) error

func Upload

func Upload(url string, params map[string]string, fileName, path string, funcResponse func(response *http.Response) error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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