httputil

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentType     = "Content-Type"
	ApplicationJson = "application/json"
)

Variables

View Source
var JsonHeader = map[string]string{
	ContentType: ApplicationJson,
}

Functions

func GoGetByUrl added in v0.0.9

func GoGetByUrl(url string) (*http.Response, error)

func GoGetRequestByUrl added in v0.0.9

func GoGetRequestByUrl(url string) (*http.Response, error)

func GoPostJson added in v0.0.9

func GoPostJson(data interface{}, url string) (*http.Response, error)

func HttpGetJson added in v0.0.7

func HttpGetJson(url string) ([]byte, error)

func HttpGetJsonWithHeader added in v0.0.9

func HttpGetJsonWithHeader(url string, header map[string]string) ([]byte, error)

func HttpPostJson added in v0.0.2

func HttpPostJson(url string, params interface{}) ([]byte, error)

func HttpPostJsonWithHeader added in v0.0.9

func HttpPostJsonWithHeader(url string, params interface{}, header map[string]string) ([]byte, error)

func PostJsonWithHeader added in v0.0.9

func PostJsonWithHeader(url string, header map[string]string, reqData any, rspData any) error

func ResponseBytes added in v0.0.4

func ResponseBytes(w http.ResponseWriter, bytes []byte, fileName string)

func ResponseExcel added in v0.0.4

func ResponseExcel(w http.ResponseWriter, f *excelize.File)

func ResponseTextFile added in v0.0.4

func ResponseTextFile(w http.ResponseWriter, file *os.File)

Types

This section is empty.

Jump to

Keyboard shortcuts

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