Documentation ¶
Index ¶
- Constants
- func Get(url string) ([]byte, error)
- func Post(url string, data []byte) ([]byte, error)
- func PostJson(url string, data []byte) ([]byte, error)
- func Put(url string, data []byte) ([]byte, error)
- func Upload(url, fileField, fileName string, f io.Reader, data map[string]string) (b []byte, err error)
- type Option
- type Request
- func (r *Request) Debug() *Request
- func (r *Request) Do(method, url string, body io.Reader) ([]byte, error)
- func (r *Request) Get(url string) ([]byte, error)
- func (r *Request) JsonContentType() *Request
- func (r *Request) Post(url string, data []byte) ([]byte, error)
- func (r *Request) PostJson(url string, data []byte) ([]byte, error)
- func (r *Request) Put(url string, data []byte) ([]byte, error)
- func (r *Request) SetContentType(contentType string) *Request
- func (r *Request) SetHeader(name, value string) *Request
- func (r *Request) SetTimeout(d time.Duration) *Request
- func (r *Request) Upload(url, fileField, fileName string, f io.Reader, data map[string]string) (b []byte, err error)
- type Tls
Constants ¶
View Source
const ( CONTENT_TYPE_XML = "application/xml" CONTENT_TYPE_JSON = "application/json" CONTENT_TYPE_FORM = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option struct { Name string Value interface{} }
func ContentTypeFormOption ¶
func ContentTypeFormOption() Option
func ContentTypeJsonOption ¶
func ContentTypeJsonOption() Option
func ContentTypeXmlOption ¶
func ContentTypeXmlOption() Option
func DebugOption ¶
func DebugOption() Option
func HeaderOption ¶
Click to show internal directories.
Click to hide internal directories.