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, field, fileName string, f io.Reader, data map[string]string) ([]byte, 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) Put(url string, data []byte) ([]byte, error)
- func (r *Request) SetContentType(contentType string) *Request
- func (r *Request) SetHearder(name, value string) *Request
- func (r *Request) SetTimeout(d time.Duration) *Request
- type Tls
Constants ¶
View Source
const ( CONTENT_TYPE_XML = "application/xml; charset=utf-8" CONTENT_TYPE_JSON = "application/json; charset=utf-8" CONTENT_TYPE_FORM = "application/x-www-form-urlencoded; charset=utf-8" )
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 ¶
type Request ¶
type Request struct { Headers map[string]string Tls *Tls // contains filtered or unexported fields }
func (*Request) JsonContentType ¶
func (*Request) SetContentType ¶
func (*Request) SetHearder ¶
Click to show internal directories.
Click to hide internal directories.