Documentation ¶
Index ¶
- Variables
- func NewClientPool() sync.Pool
- type Client
- func (c *Client) AddBodyByte(body []byte) *Client
- func (c *Client) AddBodyBytes(bodyBytes []byte) *Client
- func (c *Client) AddBodyStruct(object any) *Client
- func (c *Client) AddCookie(key, value string) *Client
- func (c *Client) AddCookies(cookies Mapper) *Client
- func (c *Client) AddFile(fileName, filePath string) *Client
- func (c *Client) AddFiles(files Mapper) *Client
- func (c *Client) AddHeader(key, value string) *Client
- func (c *Client) AddHeaders(headers Mapper) *Client
- func (c *Client) AddParam(key, value string) *Client
- func (c *Client) AddParams(params Mapper) *Client
- func (c *Client) Get(rawUrl string) (*Response, error)
- func (c *Client) Post(url string) (*Response, error)
- func (c *Client) SendFile(url string, options ...RequestOption) (*Response, error)
- func (c *Client) SetCrt(certPath, keyPath string) *Client
- func (c *Client) SetProxy(proxy string) *Client
- func (c *Client) SetTimeout(duration time.Duration) *Client
- type Mapper
- type RequestCookies
- type RequestFiles
- type RequestHeaders
- type RequestOption
- type RequestParams
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyUrlErr = errors.New("empty url") EmptyFileErr = errors.New("empty file") )
Functions ¶
func NewClientPool ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddBodyByte ¶
func (*Client) AddBodyBytes ¶
func (*Client) AddBodyStruct ¶
func (*Client) AddCookies ¶
func (*Client) AddHeaders ¶
type RequestCookies ¶
type RequestCookies struct{ Mapper }
type RequestFiles ¶
type RequestFiles struct{ Mapper }
type RequestHeaders ¶
type RequestHeaders struct{ Mapper }
type RequestOption ¶
type RequestOption struct {
// contains filtered or unexported fields
}
type RequestParams ¶
type RequestParams struct{ Mapper }
type Response ¶
type Response struct { StatusCode int Body []byte Header RequestHeaders Cookie RequestCookies }
Click to show internal directories.
Click to hide internal directories.