Documentation ¶
Index ¶
- func GetStatusString(statusCode int) string
- type APIResponse
- type Client
- func (c *Client) Delete(url string, headers map[string]string, params map[string]interface{}) (*APIResponse, error)
- func (c Client) EnsureWithoutHeader(headerName string) Client
- func (c Client) EnsureWithoutQueryParam(paramName string) Client
- func (c *Client) Get(url string, headers map[string]string, params map[string]interface{}) (*APIResponse, error)
- func (c *Client) Patch(url string, headers map[string]string, params map[string]interface{}, ...) (*APIResponse, error)
- func (c *Client) Post(url string, headers map[string]string, payload map[string]interface{}) (*APIResponse, error)
- func (c Client) WithConfig(conf *Config) Client
- func (c Client) WithHeader(key, value string) Client
- func (c Client) WithHeaders(headers map[string]string) Client
- func (c Client) WithQueryParams(newParams map[string]interface{}) Client
- type Config
- type Request
- type RequestTransform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStatusString ¶
Types ¶
type APIResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) EnsureWithoutHeader ¶
Ensure that a header is removed before requests are performed
func (Client) EnsureWithoutQueryParam ¶
Ensure that a query parameter is removed before requests are performed
func (*Client) Get ¶
func (c *Client) Get(url string, headers map[string]string, params map[string]interface{}) (*APIResponse, error)
Attempt at copying the behaviour of axios.get (JS) / resquests.get (Python)
func (Client) WithConfig ¶
Returns a copy of the client with headers, params and baseURL set by the config
func (Client) WithHeader ¶
Add a header to the list of default headers
func (Client) WithHeaders ¶
Add headers to the list of default headers
func (Client) WithQueryParams ¶
Add query parameters to default query parameters
Click to show internal directories.
Click to hide internal directories.