Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient represents a client to send HTTP requests.
func NewHTTPClient ¶
func NewHTTPClient(opts ...HTTPOption) *HTTPClient
NewHTTPClient is used to build a new HTTPClient.
func (*HTTPClient) IsFailureStatusCode ¶
func (r *HTTPClient) IsFailureStatusCode(resp *http.Response) bool
func (*HTTPClient) SendRequest ¶
func (*HTTPClient) SendRequestRaw ¶
type HTTPOption ¶
type HTTPOption func(*HTTPClient)
func WithBefore ¶
func WithBefore(fn func(*http.Request) error) HTTPOption
func WithClient ¶
func WithClient(c *http.Client) HTTPOption
func WithDecoder ¶
func WithDecoder(fn func([]byte, any) error) HTTPOption
func WithEncoder ¶
func WithEncoder(fn func(obj any) ([]byte, error)) HTTPOption
Click to show internal directories.
Click to hide internal directories.