Documentation ¶
Overview ¶
Package httpclient http 客户端
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestOption ¶
type RequestOption struct { // Timeout 超时 Timeout time.Duration // Header 请求Header Header http.Header // Body 请求Body Body io.Reader // 自动执行重定向 AutoRedirect bool }
RequestOption 请求可选项
type ResponseWrapper ¶
type ResponseWrapper struct { // StatusCode 响应码 StatusCode int // Body 响应Body Body []byte // Header 响应Header Header http.Header }
ResponseWrapper 响应包装
func PostJSON ¶
func PostJSON(url string, opt *RequestOption) (*ResponseWrapper, error)
PostJSON POST请求,发送JSON格式数据
func PostParams ¶
func PostParams(url string, opt *RequestOption) (*ResponseWrapper, error)
PostParams POST请求按key value传递参数
Click to show internal directories.
Click to hide internal directories.