Versions in this module Expand all Collapse all v1 v1.1.1 Mar 21, 2023 Changes in this version type Client + func (c *Client) Patch(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) type Response + func Patch(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) v1.0.0 Jun 7, 2022 Changes in this version + const CLIENT_ERROR_BAD_REQUEST + const CLIENT_ERROR_CONFLICT + const CLIENT_ERROR_EXPECTATION_FAILED + const CLIENT_ERROR_FAILED_DEPENDENCY + const CLIENT_ERROR_FORBIDDEN + const CLIENT_ERROR_GONE + const CLIENT_ERROR_LENGTH_REQUIRED + const CLIENT_ERROR_LOCKED + const CLIENT_ERROR_METHOD_NOT_ALLOWED + const CLIENT_ERROR_NOT_ACCEPTABLE + const CLIENT_ERROR_NOT_FOUND + const CLIENT_ERROR_PAYMENT_REQUIRED + const CLIENT_ERROR_PRECONDITION_FAILED + const CLIENT_ERROR_PROXY_AUTHENTIFICATION_REQUIRED + const CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE + const CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE + const CLIENT_ERROR_REQUEST_TIMEOUT + const CLIENT_ERROR_REQUEST_URI_TOO_LONG + const CLIENT_ERROR_UNAUTHORIZED + const CLIENT_ERROR_UNPROCESSABLE_ENTITY + const CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE + const INFO_CONTINUE + const INFO_PROCESSING + const INFO_SWITCHING_PROTOCOL + const REDIRECTION_MOVED_PERMANENTLY + const REDIRECTION_MOVED_TEMPORARILY + const REDIRECTION_MULTIPLE_CHOICES + const REDIRECTION_NOT_MODIFIED + const REDIRECTION_SEE_OTHER + const REDIRECTION_TEMPORARY_REDIRECT + const REDIRECTION_USE_PROXY + const SERVER_ERROR_BAD_GATEWAY + const SERVER_ERROR_GATEWAY_TIMEOUT + const SERVER_ERROR_HTTP_VERSION_NOT_SUPPORTED + const SERVER_ERROR_INSUFFICIENT_STORAGE + const SERVER_ERROR_INTERNAL + const SERVER_ERROR_NOT_IMPLEMENTED + const SERVER_ERROR_SERVICE_UNAVAILABLE + const SUCCESS_ACCEPTED + const SUCCESS_CREATED + const SUCCESS_MULTI_STATUS + const SUCCESS_NON_AUTHORITATIVE + const SUCCESS_NO_CONTENT + const SUCCESS_OK + const SUCCESS_PARTIAL_CONTENT + const SUCCESS_RESET_CONTENT + type Body struct + func (b *Body) Content() string + func (b *Body) JSON(v interface{}) error + type Client struct + func NewClient(opts ...ClientOptionFunc) *Client + func (c *Client) Delete(url string, options ...RequestOptionFunc) (*Response, error) + func (c *Client) Get(url string, options ...RequestOptionFunc) (*Response, error) + func (c *Client) Head(url string, options ...RequestOptionFunc) (*Response, error) + func (c *Client) Post(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) + func (c *Client) Put(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) + func (c *Client) Trace(url string, options ...RequestOptionFunc) (*Response, error) + type ClientOptionFunc func(*Client) + func CustomClient(c HTTPClient) ClientOptionFunc + type HTTPClient interface + Do func(r *http.Request) (*http.Response, error) + type Header struct + Key string + Values []string + type Request struct + Body io.Reader + Fragment string + Headers []Header + Method string + QueryParams url.Values + URL string + User string + func (r Request) GetUrl() string + type RequestOptionFunc func(*Request) error + func WithBasicAuth(token string) RequestOptionFunc + func WithBearerToken(token string) RequestOptionFunc + func WithHeader(key, value string) RequestOptionFunc + func WithQueryParam(key string, values ...string) RequestOptionFunc + func WithQueryParams(params url.Values) RequestOptionFunc + type Response struct + Headers []Header + func Delete(url string, options ...RequestOptionFunc) (*Response, error) + func Get(url string, options ...RequestOptionFunc) (*Response, error) + func Head(url string, options ...RequestOptionFunc) (*Response, error) + func Post(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) + func Put(url string, body io.Reader, options ...RequestOptionFunc) (*Response, error) + func Trace(url string, options ...RequestOptionFunc) (*Response, error) + func (r *Response) Header(key string) string + type Status struct + Code int + Reason string + func (s *Status) String() string + func (s Status) IsClientError() bool + func (s Status) IsError() bool + func (s Status) IsInformational() bool + func (s Status) IsRedirect() bool + func (s Status) IsServerError() bool + func (s Status) IsSuccess() bool