Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client interface { // Deprecated: Should use GetWithContext() method instead of Get() method. Get(u *url.URL, opts ...RequestOpts) (Response, error) GetWithContext(ctx context.Context, u *url.URL, opts ...RequestOpts) (Response, error) // Deprecated: Should use PostWithContext() method instead of Post() method. Post(u *url.URL, payload io.Reader, opts ...RequestOpts) (Response, error) PostWithContext(ctx context.Context, u *url.URL, payload io.Reader, opts ...RequestOpts) (Response, error) }
Client is inteface class for HTTP client.
type ClientOpts ¶
type ClientOpts func(*client)
func WithHTTPClient ¶
func WithHTTPClient(cli *http.Client) ClientOpts
WithProtocol returns function for setting http.Client.
type RequestOpts ¶
func WithContext ¶
func WithContext(ctx context.Context) RequestOpts
WithProtocol returns function for setting context.Context. Deprecated: should not be used
func WithRequestHeaderAdd ¶
func WithRequestHeaderAdd(name, value string) RequestOpts
WithRequestHeaderAdd returns function for adding request header in http.Request.
func WithRequestHeaderSet ¶
func WithRequestHeaderSet(name, value string) RequestOpts
WithRequestHeaderSet returns function for setting request header in http.Request.
Click to show internal directories.
Click to hide internal directories.