http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Zlib Imports: 8 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 Http

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

func (*Http) Do

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

func (*Http) DoBytes

func (hp *Http) DoBytes(method string, url string, buf []byte) ([]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, set SetHeaderFunc) ([]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

type SetHeaderFunc

type SetHeaderFunc func(h *http.Header)

Jump to

Keyboard shortcuts

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