Versions in this module Expand all Collapse all v1 v1.1.2 Aug 15, 2024 v1.1.1 Jun 16, 2024 Changes in this version + const ContentForm + const ContentFormMultipart + const ContentJSON + const ContentStream + const ContentText + const HeaderAccept + const HeaderAuthorization + const HeaderContentType + const MaxFormMemory + func Do(ctx context.Context, method, reqURL string, body []byte, options ...Option) (*http.Response, error) + func Get(ctx context.Context, reqURL string, options ...Option) (*http.Response, error) + func Post(ctx context.Context, reqURL string, body []byte, options ...Option) (*http.Response, error) + func PostForm(ctx context.Context, reqURL string, data url.Values, options ...Option) (*http.Response, error) + func PostJSON(ctx context.Context, reqURL string, body []byte, options ...Option) (*http.Response, error) + func Upload(ctx context.Context, reqURL string, form UploadForm, options ...Option) (*http.Response, error) + type Client interface + Do func(ctx context.Context, method, reqURL string, body []byte, opts ...Option) (*http.Response, error) + Upload func(ctx context.Context, reqURL string, form UploadForm, opts ...Option) (*http.Response, error) + func NewDefaultClient(certs ...tls.Certificate) Client + func NewHTTPClient(c *http.Client) Client + type FormFileFunc func(w io.Writer) error + type Option func(o *options) + func WithClose() Option + func WithCookies(cookies ...*http.Cookie) Option + func WithHeader(key string, vals ...string) Option + type UploadField func(form *uploadform) + func WithFormField(name, value string) UploadField + func WithFormFile(fieldname, filename string, fn FormFileFunc) UploadField + type UploadForm interface + Field func(name string) string + Write func(w *multipart.Writer) error + func NewUploadForm(fields ...UploadField) UploadForm