http

package
v0.5.39 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Zlib Imports: 11 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBuffer

func ToBuffer(url string, callback BufferCallback) error

func ToFile

func ToFile(url string, filename string) error

func UploadFile

func UploadFile(head api.Request, url string, file string) ([]byte, error)

Types

type BufferCallback

type BufferCallback func([]byte) error

type HeaderFunc added in v0.5.0

type HeaderFunc func(h *http.Header)

type Http

type Http struct {
	HttpStatus         int
	ContentDisposition string
	ContentType        string
	ContentLength      int64
}

func (*Http) ConvertTo added in v0.2.6

func (hp *Http) ConvertTo(data interface{}) url2.Values

func (*Http) Do

func (hp *Http) Do(method string, url string, body io.Reader, headerFunc HeaderFunc) ([]byte, error)

func (*Http) DoBytes

func (hp *Http) DoBytes(method string, url string, buf []byte) ([]byte, error)

func (*Http) DoForm added in v0.2.6

func (hp *Http) DoForm(url string) ([]byte, error)

DoForm url http://api.xxx.com/ssddd?key=ddd&ddd=sfsf

func (*Http) DoFormWith added in v0.2.6

func (hp *Http) DoFormWith(url, query string) ([]byte, error)

DoFormWith query ssddd=sdsfs&sfssfs=sfsssfs&sfsfsfs&

func (*Http) DoFormWithValues added in v0.2.6

func (hp *Http) DoFormWithValues(url string, values url2.Values) ([]byte, error)

func (*Http) DoMultiForm added in v0.2.6

func (hp *Http) DoMultiForm(method, url string) ([]byte, error)

func (*Http) DoMultiFormWith added in v0.2.6

func (hp *Http) DoMultiFormWith(method, url, query string) ([]byte, error)

func (*Http) DoMultiFormWithValues added in v0.2.6

func (hp *Http) DoMultiFormWithValues(method, url string, form url2.Values) ([]byte, error)

func (*Http) DoString

func (hp *Http) DoString(method string, url string, buf []byte) (string, error)

func (*Http) DoWithHead

func (hp *Http) DoWithHead(method string, url string, buf []byte, headerFunc HeaderFunc) ([]byte, error)

func (*Http) FileName

func (hp *Http) FileName() string

func (*Http) GetContentType

func (hp *Http) GetContentType() string

func (*Http) IsFile

func (hp *Http) IsFile() bool

Jump to

Keyboard shortcuts

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