httpclient

package module
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 14 Imported by: 23

README

httpclient

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientPool

type ClientPool struct {
	GlobalHeaders map[string]string
	NoBody        bool
	// contains filtered or unexported fields
}

func GetClient

func GetClient(timeout time.Duration) *ClientPool

func GetClientH2C

func GetClientH2C(timeout time.Duration) *ClientPool

func (*ClientPool) Delete

func (cp *ClientPool) Delete(url string, data interface{}, headers ...string) *Result

func (*ClientPool) Do

func (cp *ClientPool) Do(method, url string, data interface{}, headers ...string) *Result

func (*ClientPool) DoByRequest

func (cp *ClientPool) DoByRequest(request *http.Request, method, url string, data interface{}, settedHeaders ...string) *Result

func (*ClientPool) EnableRedirect

func (cp *ClientPool) EnableRedirect()

func (*ClientPool) Get

func (cp *ClientPool) Get(url string, headers ...string) *Result

func (*ClientPool) Head

func (cp *ClientPool) Head(url string, data interface{}, headers ...string) *Result

func (*ClientPool) Post

func (cp *ClientPool) Post(url string, data interface{}, headers ...string) *Result

func (*ClientPool) Put

func (cp *ClientPool) Put(url string, data interface{}, headers ...string) *Result

func (*ClientPool) SetGlobalHeader

func (cp *ClientPool) SetGlobalHeader(k, v string)

type Result

type Result struct {
	Error    error
	Response *http.Response
	// contains filtered or unexported fields
}

func (*Result) Arr

func (rs *Result) Arr() []interface{}

func (*Result) Bytes

func (rs *Result) Bytes() []byte

func (*Result) Map

func (rs *Result) Map() map[string]interface{}

func (*Result) String

func (rs *Result) String() string

func (*Result) To

func (rs *Result) To(result interface{}) error

func (*Result) ToAction

func (rs *Result) ToAction(result interface{}) string

Jump to

Keyboard shortcuts

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