httpclient

package
v0.9.29 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(url string, header Header, data io.Reader) (resp *http.Response, err error)

func Do

func Do(t string, url string, header Header, data io.Reader) (*http.Response, error)

func Get

func Get(url string, header Header, data io.Reader) (resp *http.Response, err error)

func Post

func Post(url string, header Header, data io.Reader) (resp *http.Response, err error)

func Put

func Put(url string, header Header, data io.Reader) (resp *http.Response, err error)

func SetBasicAuth

func SetBasicAuth(username, password string)

func SetTokenAuth

func SetTokenAuth(token string)

Types

type Auth

type Auth struct {
	Type     string
	Username string
	Password string
	Token    string
}

type Form

type Form struct {
	Length      int64
	Reader      io.Reader
	ContentType string
	// contains filtered or unexported fields
}

func NewForm

func NewForm() (f *Form)

func (*Form) AddFile

func (f *Form) AddFile(name, path string)

func (*Form) AddFileReader

func (f *Form) AddFileReader(name string, r io.Reader, size int64)

func (*Form) AddParam

func (f *Form) AddParam(key, val string)

func (*Form) Create

func (f *Form) Create() (err error)

func (*Form) Dump

func (f *Form) Dump() (buf []byte)
type Header map[string]string

Jump to

Keyboard shortcuts

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