Documentation
¶
Overview ¶
Package httpclient provides a convenient HTTP client with request builders. It supports both regular and multipart requests with deferred operations.
Index ¶
- type Client
- func (c *Client) MultipartPOST(ctx context.Context, path string) *request.Multipart
- func (c *Client) MultipartPUT(ctx context.Context, path string) *request.Multipart
- func (c *Client) RequestDELETE(ctx context.Context, path string) *request.Request
- func (c *Client) RequestGET(ctx context.Context, path string) *request.Request
- func (c *Client) RequestPATCH(ctx context.Context, path string) *request.Request
- func (c *Client) RequestPOST(ctx context.Context, path string) *request.Request
- func (c *Client) RequestPUT(ctx context.Context, path string) *request.Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client that wraps http.Client with convenience methods. It maintains a base URL and provides request builders for different HTTP methods.
func NewClient ¶
NewClient creates a new HTTP client with the given http.Client and base URL. Returns an error if the base URL is invalid.
func (*Client) MultipartPOST ¶ added in v1.2.0
MultipartPOST creates a multipart POST request builder for the given path.
func (*Client) MultipartPUT ¶ added in v1.3.0
MultipartPUT creates a multipart PUT request builder for the given path.
func (*Client) RequestDELETE ¶ added in v1.2.0
RequestDELETE creates a DELETE request builder for the given path.
func (*Client) RequestGET ¶ added in v1.2.0
RequestGET creates a GET request builder for the given path.
func (*Client) RequestPATCH ¶ added in v1.2.0
RequestPATCH creates a PATCH request builder for the given path.
func (*Client) RequestPOST ¶ added in v1.2.0
RequestPOST creates a POST request builder for the given path.