Versions in this module Expand all Collapse all v0 v0.1.0 Sep 3, 2022 v0.0.1 Sep 3, 2022 Changes in this version + const LogModeAll + const LogModeNone + const LogModeRequest + const LogModeRequestBody + const LogModeRequestHeaders + const LogModeResponse + const LogModeResponseBody + const LogModeResponseHeaders + func Bytes(r *http.Response) ([]byte, error) + func Drain(r *http.Response) error + func ResponseErr(r *http.Response) error + func ResponseErrAndBytes(r *http.Response) ([]byte, error) + func ResponseErrBytes(r *http.Response) ([]byte, error) + func ResponseErrOrBytes(r *http.Response) ([]byte, error) + type Client struct + func NewClient(base string, logMode uint) (*Client, error) + func NewClientWithOptions(cli *http.Client, base *URL, logMode uint) *Client + func (c *Client) Do(req *http.Request, options ...RequestOption) (*http.Response, error) + func (c *Client) Get(url string, options ...RequestOption) (*http.Response, error) + func (c *Client) Head(url string, options ...RequestOption) (resp *http.Response, err error) + func (c *Client) Post(url string, contentType string, body io.Reader, options ...RequestOption) (*http.Response, error) + func (c *Client) PostForm(url string, data urlpkg.Values, options ...RequestOption) (*http.Response, error) + func (c *Client) PostJsonForm(urlPath string, data hexa.Map, options ...RequestOption) (*http.Response, error) + type HttpErr struct + Code int + Status string + func (err HttpErr) Error() string + type RequestOption func(req *http.Request) error + func AuthenticateHeader(header string, tokenType string, token string) RequestOption + func AuthorizationToken(tokenType string, token string) RequestOption + func BasicAuth(username string, password string) RequestOption + func BearerToken(token string) RequestOption + func QueryParams(params hexa.Map) RequestOption + type URL struct + func NewURL(base string) (*URL, error) + func (u *URL) URL(url string, options ...URLOption) (resultUrl *urlpkg.URL, err error) + type URLOption func(url *urlpkg.URL) error + func UrlQueryParams(params hexa.Map) URLOption