httpUtil

package
v0.0.0-...-3f3ae68 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(baseUrl string, param map[string]string) (body []byte, err error)

func Post

func Post(url string, params RequestParams) ([]byte, error)

func RequestSync

func RequestSync(method, url string, header map[string]string, body []byte, httpWg *sync.WaitGroup, resp *Res, err error)

Types

type RequestParams

type RequestParams struct {
	Header  map[string]string
	Body    []byte
	Timeout time.Duration
}

type Res

type Res struct {
	Header http.Header
	Body   []byte
	Code   int
}

func Request

func Request(method, url string, header map[string]string, body []byte) (*Res, error)

Jump to

Keyboard shortcuts

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