Documentation
¶
Overview ¶
Package httpx wraps bogdanfinn/tls-client for Chrome-like TLS fingerprints.
Index ¶
- func ReadAll(resp *http.Response) ([]byte, error)
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) Delete(urlStr string, headers map[string]string) (*http.Response, error)
- func (c *Client) DeleteWithContext(ctx context.Context, urlStr string, headers map[string]string) (*http.Response, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(urlStr string, headers map[string]string) (*http.Response, error)
- func (c *Client) GetWithContext(ctx context.Context, urlStr string, headers map[string]string) (*http.Response, error)
- func (c *Client) PostForm(urlStr string, form url.Values, headers map[string]string) (*http.Response, error)
- func (c *Client) PostFormWithContext(ctx context.Context, urlStr string, form url.Values, headers map[string]string) (*http.Response, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin wrapper around tls-client with proxy support.
func (*Client) CloseIdleConnections ¶ added in v0.6.0
func (c *Client) CloseIdleConnections()
CloseIdleConnections 关闭底层 transport 持有的空闲连接。
func (*Client) Delete ¶
Delete issues a DELETE with query params already in urlStr using context.Background().
func (*Client) DeleteWithContext ¶ added in v0.6.0
func (c *Client) DeleteWithContext(ctx context.Context, urlStr string, headers map[string]string) (*http.Response, error)
DeleteWithContext issues a context-aware DELETE.
func (*Client) Do ¶
Do executes a request. The request context controls cancellation through the underlying transport (dial, header read and body read all observe ctx.Done()).
func (*Client) GetWithContext ¶ added in v0.6.0
func (c *Client) GetWithContext(ctx context.Context, urlStr string, headers map[string]string) (*http.Response, error)
GetWithContext issues a context-aware GET.
Click to show internal directories.
Click to hide internal directories.