http

package
v0.0.0-...-0f65a33 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = NewHttpClient(time.Second * 5)
View Source
var DefaultWithConcurrent = NewConcurrentHttpClient(time.Second*5, 100, 50)

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	*http.Client
}

func NewConcurrentHttpClient

func NewConcurrentHttpClient(timeOut time.Duration, MaxIdleConn, maxIdleConnPerHost int) *HttpClient

func NewHttpClient

func NewHttpClient(timeOut time.Duration) *HttpClient

func (*HttpClient) HttpGet

func (h *HttpClient) HttpGet(url string, data url.Values) (resp string, err error)

func (*HttpClient) HttpPost

func (h *HttpClient) HttpPost(url string, bodyType string, body string) (resp string, err error)

func (*HttpClient) HttpPostForm

func (h *HttpClient) HttpPostForm(url string, data url.Values) (resp string, err error)

func (*HttpClient) HttpPostJson

func (h *HttpClient) HttpPostJson(url string, data interface{}) (resp string, err error)

func (*HttpClient) HttpPostWithHeader

func (h *HttpClient) HttpPostWithHeader(url string, headers map[string]string, body string) (resp string, err error)

func (*HttpClient) HttpPostXml

func (h *HttpClient) HttpPostXml(url string, data url.Values) (resp string, err error)

func (*HttpClient) HttpPut

func (h *HttpClient) HttpPut(url string, bodyType string, body string) (resp string, err error)

func (*HttpClient) HttpPutJson

func (h *HttpClient) HttpPutJson(url string, data interface{}) (resp string, err error)

Jump to

Keyboard shortcuts

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