Documentation ¶
Index ¶
- Variables
- type HttpClient
- func (h *HttpClient) HttpGet(url string, data url.Values) (resp string, err error)
- func (h *HttpClient) HttpPost(url string, bodyType string, body string) (resp string, err error)
- func (h *HttpClient) HttpPostForm(url string, data url.Values) (resp string, err error)
- func (h *HttpClient) HttpPostJson(url string, data interface{}) (resp string, err error)
- func (h *HttpClient) HttpPostWithHeader(url string, headers map[string]string, body string) (resp string, err error)
- func (h *HttpClient) HttpPostXml(url string, data url.Values) (resp string, err error)
- func (h *HttpClient) HttpPut(url string, bodyType string, body string) (resp string, err error)
- func (h *HttpClient) HttpPutJson(url string, data interface{}) (resp string, err error)
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 ¶
func NewConcurrentHttpClient ¶
func NewConcurrentHttpClient(timeOut time.Duration, MaxIdleConn, maxIdleConnPerHost int) *HttpClient
func NewHttpClient ¶
func NewHttpClient(timeOut time.Duration) *HttpClient
func (*HttpClient) HttpPostForm ¶
func (*HttpClient) HttpPostJson ¶
func (h *HttpClient) HttpPostJson(url string, data interface{}) (resp string, err error)
func (*HttpClient) HttpPostWithHeader ¶
func (*HttpClient) HttpPostXml ¶
func (*HttpClient) HttpPutJson ¶
func (h *HttpClient) HttpPutJson(url string, data interface{}) (resp string, err error)
Click to show internal directories.
Click to hide internal directories.