httputil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderContentType the Content-Type http header
	HeaderContentType = "Content-Type"
)

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(url string) (resp *http.Response, err error)

HttpGet get http resource

func HttpGetWithCookie

func HttpGetWithCookie(url string, header http.Header, cookies ...*http.Cookie) (resp *http.Response, err error)

HttpGetWithCookie get http resource with cookies

func HttpPost

func HttpPost(url string, data url.Values) (resp *http.Response, err error)

HttpPost send a post request with form data

func HttpPostFileChunkWithCookie

func HttpPostFileChunkWithCookie(url string, fieldName string, fileName string, data url.Values, chunk []byte, cookies ...*http.Cookie) (resp *http.Response, err error)

HttpPostFileChunkWithCookie send a post request with form data, a file chunk and cookies

func HttpPostWithCookie

func HttpPostWithCookie(url string, data url.Values, cookies ...*http.Cookie) (resp *http.Response, err error)

HttpPostWithCookie send a post request with form data and cookies

func HttpPostWithoutRedirect

func HttpPostWithoutRedirect(url string, data url.Values) (resp *http.Response, err error)

HttpPostWithoutRedirect send a post request with form data and not auto redirect

func Init added in v0.4.2

func Init(insecureSkipVerify bool, certFile string) error

Init init default http util

func NewTLSConfig added in v0.4.2

func NewTLSConfig(insecureSkipVerify bool, certFile string) (*tls.Config, error)

NewTLSConfig create a tls config

Types

This section is empty.

Jump to

Keyboard shortcuts

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