Documentation ¶
Overview ¶
Package httpcli is toolkit for simplification of http request
Index ¶
- Constants
- Variables
- type Client
- func (client *Client) Do() (err error)
- func (client *Client) GetBody() []byte
- func (client *Client) GetUrl() string
- func (client *Client) Info() string
- func (client *Client) Request() *http.Request
- func (client *Client) Response() (resp *response, err error)
- func (client *Client) Undo() *Client
- func (client *Client) Url(urlStr string) *Client
- func (client *Client) WithBody(body interface{}) *Client
- func (client *Client) WithHeader(k, v string) *Client
- func (client *Client) WithHeaders(params Params) *Client
- func (client *Client) WithJson(content string) *Client
- func (client *Client) WithParam(k, v string) *Client
- func (client *Client) WithParams(params Params) *Client
- func (client *Client) WithTLS() *Client
- type Params
- type Proto
Constants ¶
View Source
const ( HTTP1 = "HTTP/1.1" HTTP2 = "HTTP/2.0" )
Variables ¶
View Source
var ErrNilResponse = errors.New("nil response")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a toolkit base on http.Client
func (*Client) Response ¶
Response execute the request and get the response, return error if error happens.
func (*Client) WithHeader ¶
WithHeader set the request header.
func (*Client) WithHeaders ¶
WithHeaders set multiple headers.
func (*Client) WithParams ¶
WithParams set multiple params to the request.
Click to show internal directories.
Click to hide internal directories.