Documentation ¶
Index ¶
- Constants
- func AssertHttpStatusCodeSuccessful(statusCode int) error
- func Get(url string, options ...Option) (int, []byte, error)
- func GetForResponse(url string, options ...Option) (*http.Response, error)
- func Post(url string, options ...Option) (int, []byte, error)
- func PostForResponse(url string, options ...Option) (*http.Response, error)
- func Upload(url string, fileParams map[string]string, options ...Option) (int, []byte, error)
- func UploadForResponse(url string, fileParams map[string]string, options ...Option) (*http.Response, error)
- type Option
Constants ¶
View Source
const ( // DefaultTimeout 发送请求的默认超时时间. /* PS: (1) 个人实测,对于 http.Client 结构体,Timeout 默认为30s. (2) e.g. yozo的网访问谷歌必定超时. */ DefaultTimeout = time.Second * 10 )
Variables ¶
This section is empty.
Functions ¶
func GetForResponse ¶ added in v2.0.13
GetForResponse
@return !!!: 第一个返回值如果不为nil的话,一般来说需要手动调用 "resp.Body.Close()".
func PostForResponse ¶ added in v2.0.13
PostForResponse
@return !!!: 第一个返回值如果不为nil的话,一般来说需要手动调用 "resp.Body.Close()".
Types ¶
type Option ¶ added in v2.0.13
type Option func(opts *options)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.