requests

package module
v0.0.0-...-2239865 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

README

go.requests

Request of Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupClient

func SetupClient(c http.CookieJar, keepalive, timeout time.Duration, proxy string, skipVerifySSL bool) error

func UploadFile

func UploadFile(s string, fp *os.File) error

func UploadHandlerFunc

func UploadHandlerFunc(root, temp, filename string, w http.ResponseWriter, r *http.Request, done func()) error

Types

type FileChunk

type FileChunk struct {
	RefFile     string
	TotalChunks uint
	TotalMD5    string
	TotalSize   uint64
	ChunkNum    uint
	ChunkSize   uint64
	ChunkMD5    string
	// contains filtered or unexported fields
}

func ParseChunk

func ParseChunk(vals url.Values) FileChunk

func (FileChunk) Query

func (fc FileChunk) Query() url.Values

func (FileChunk) URL

func (fc FileChunk) URL(s string) string

func (FileChunk) Upload

func (fc FileChunk) Upload(s string) error

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(method, url string, body io.Reader) (*Request, error)

type Response

type Response struct {
	// contains filtered or unexported fields
}

func Do

func Do(req *Request) (*Response, error)

func Get

func Get(url string) (*Response, error)

func Post

func Post(url string, contentType string, body io.Reader) (*Response, error)

func PostForm

func PostForm(url string, data url.Values) (resp *Response, err error)

func PostJSON

func PostJSON(url string, o interface{}) (resp *Response, err error)

func PostXML

func PostXML(url string, o interface{}) (resp *Response, err error)

func PostYAML

func PostYAML(url string, o interface{}) (resp *Response, err error)

func (*Response) Bytes

func (resp *Response) Bytes() ([]byte, error)

func (*Response) JSON

func (resp *Response) JSON(o interface{}) error

func (*Response) XML

func (resp *Response) XML(o interface{}) error

func (*Response) YAML

func (resp *Response) YAML(o interface{}) error

Jump to

Keyboard shortcuts

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