Documentation
¶
Index ¶
- func GetResponseCookies(resp *http.Response) []*http.Cookie
- type Certificate
- type ClientConfig
- type HttpClient
- func (c *HttpClient) ClearCookies()
- func (c *HttpClient) GetCookies(urlStr string) []*http.Cookie
- func (c *HttpClient) Send(request *models.HttpRequest) (*models.HttpResponse, error)
- func (c *HttpClient) SendWithContext(ctx context.Context, request *models.HttpRequest) (*models.HttpResponse, error)
- func (c *HttpClient) SetCookies(urlStr string, cookies []*http.Cookie)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Certificate ¶
Certificate holds TLS certificate configuration
type ClientConfig ¶
type ClientConfig struct {
Timeout time.Duration
FollowRedirects bool
InsecureSSL bool
Proxy string
ExcludeProxy []string
RememberCookies bool
DefaultHeaders map[string]string
Certificates map[string]Certificate
}
ClientConfig holds client configuration
func DefaultConfig ¶
func DefaultConfig() *ClientConfig
DefaultConfig returns a default client configuration
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
HttpClient is an HTTP client with auth support
func NewHttpClient ¶
func NewHttpClient(config *ClientConfig) (*HttpClient, error)
NewHttpClient creates a new HTTP client
func (*HttpClient) ClearCookies ¶
func (c *HttpClient) ClearCookies()
ClearCookies clears all stored cookies
func (*HttpClient) GetCookies ¶ added in v0.2.5
func (c *HttpClient) GetCookies(urlStr string) []*http.Cookie
GetCookies returns all cookies for a given URL
func (*HttpClient) Send ¶
func (c *HttpClient) Send(request *models.HttpRequest) (*models.HttpResponse, error)
Send sends an HTTP request and returns the response
func (*HttpClient) SendWithContext ¶
func (c *HttpClient) SendWithContext(ctx context.Context, request *models.HttpRequest) (*models.HttpResponse, error)
SendWithContext sends an HTTP request with context
func (*HttpClient) SetCookies ¶ added in v0.2.5
func (c *HttpClient) SetCookies(urlStr string, cookies []*http.Cookie)
SetCookies sets cookies for a given URL
Click to show internal directories.
Click to hide internal directories.