http

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHttpClient

func GetHttpClient(config *tls.Config) *http.Client

func GetTLSConfigGlobal

func GetTLSConfigGlobal() (globalConfig *tls.Config)

GetTLSConfigGlobal return the pointer to global config

func SetInsuredGlobal

func SetInsuredGlobal()

func SetRootCAs

func SetRootCAs(config *tls.Config, rootPEMs []string)

Types

type Response

type Response http.Response

func Get

func Get(url string, client *http.Client) Response

func Post

func Post(url string, contentType string, body io.Reader, client *http.Client) Response

func PostForm added in v1.5.4

func PostForm(_url string, data url.Values, client *http.Client) Response

func PostJson

func PostJson(url string, body interface{}, client *http.Client) Response

func (Response) BodyBytes

func (t Response) BodyBytes() []byte

func (Response) Trim

func (t Response) Trim() ResponseJSON

type ResponseJSON

type ResponseJSON struct {
	StatusCode int // e.g. 200
	Body       string
}

Jump to

Keyboard shortcuts

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