httpclient

package module
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 21 Imported by: 11

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
	Debug            bool
	DownloadPartSize int64
	// 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) Download added in v1.7.1

func (cp *ClientPool) Download(filename, url string, callback func(start, end int64, ok bool, finished, total int64), headers ...string) (*Result, error)

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, headers ...string) *Result

func (*ClientPool) MPost added in v1.7.1

func (cp *ClientPool) MPost(url string, formData map[string]string, files map[string]interface{}, headers ...string) (*Result, []error)

func (*ClientPool) ManualDo added in v0.6.11

func (cp *ClientPool) ManualDo(method, 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 Form added in v0.5.30

type Form = map[string]string

type Range added in v1.7.1

type Range struct {
	Start int64
	End   int64
}

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) Save added in v1.7.1

func (rs *Result) Save(filename string) error

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