Documentation ¶
Index ¶
- func FastGet(url string, timeOut time.Duration) (*fasthttp.Response, error)
- func FastPost(url string, body []byte, timeOut time.Duration) (*fasthttp.Response, error)
- func FastPostString(url string, body string, timeOut time.Duration) (*fasthttp.Response, error)
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
- func Upload(client *http.Client, url string, values map[string]io.Reader) (err error)
- type Headers
- type HttpBinHeaders
- type HttpbinPostBody
- type IPbody
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FastPostString ¶
PostString
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
Types ¶
type Headers ¶
type Headers struct { Accept string `json:"Accept"` AcceptEncoding string `json:"Accept-Encoding"` AcceptLanguage string `json:"Accept-Language"` Connection string `json:"Connection"` Cookie string `json:"Cookie"` Dnt string `json:"Dnt"` Host string `json:"Host"` Referer string `json:"Referer"` UserAgent string `json:"User-Agent"` }
type for http://httpbin.org for test only
type HttpBinHeaders ¶
type HttpBinHeaders struct {
Headers `json:"headers"`
}
type for http://httpbin.org for test only
type HttpbinPostBody ¶
type HttpbinPostBody struct { Args struct { } `json:"args"` Data string `json:"data"` Files struct { } `json:"files"` Form struct { } `json:"form"` Headers struct { Accept string `json:"Accept"` AcceptEncoding string `json:"Accept-Encoding"` CacheControl string `json:"Cache-Control"` Connection string `json:"Connection"` ContentLength string `json:"Content-Length"` ContentType string `json:"Content-Type"` Host string `json:"Host"` PostmanToken string `json:"Postman-Token"` UserAgent string `json:"User-Agent"` } `json:"headers"` JSON interface{} `json:"json"` Origin string `json:"origin"` URL string `json:"url"` }
type for http://httpbin.org for test only
type IPbody ¶
type IPbody struct {
Origin string `json:"origin"`
}
type for http://httpbin.org for test only
Click to show internal directories.
Click to hide internal directories.