Documentation ¶
Index ¶
- Constants
- func IgnoreInsecureHTTPS() func(*Client)
- func IgnoreProtocol() func(*Client)
- func SetAuthenticator(authenticator authenticator) func(*Client)
- func SetFormat(format string) func(*Client)
- type Client
- func (r *Client) Delete(ctx context.Context, route string, params url.Values) error
- func (r *Client) Get(ctx context.Context, route string, params url.Values, output interface{}) error
- func (r *Client) Head(ctx context.Context, route string, params url.Values, ...) error
- func (r *Client) Patch(ctx context.Context, route string, input interface{}) error
- func (r *Client) Perform(ctx context.Context, verb string, route string, params url.Values, ...) error
- func (r *Client) Post(ctx context.Context, route string, params url.Values, input interface{}, ...) error
- func (r *Client) Put(ctx context.Context, route string, params url.Values, input interface{}, ...) error
- type MultipartRequest
Constants ¶
const ( MimeTypeBlank = "" MimeTypeHead = "head" MimeTypeJSON = "application/json" MimeTypeMultipartForm = "multipart/form-data" MimeTypeURLEncodedForm = "application/x-www-form-urlencoded" )
HTTP formats
Variables ¶
This section is empty.
Functions ¶
func IgnoreInsecureHTTPS ¶
func IgnoreInsecureHTTPS() func(*Client)
IgnoreInsecureHTTPS certificates shall never be used in production
func IgnoreProtocol ¶
func IgnoreProtocol() func(*Client)
IgnoreProtocol by setting corresponding boolean to true
Types ¶
type Client ¶
Client represents a HTTP REST API client requesting a configured endpoint.
func NewClient ¶
NewClient is HTTP Client constructor
func (*Client) Delete ¶
Delete ... Fixed HTTP method Delete an entity using route as base url then params as query parameters A delete request is agnostic from the format since no body input/output is considered
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, route string, params url.Values, output interface{}) error
Get ... Overridable HTTP method Get an entity using route as base url then params as query parameters
func (*Client) Head ¶
func (r *Client) Head(ctx context.Context, route string, params url.Values, output map[string][]string) error
Head ... Fixed HTTP method Head entity using route as base url then params as query parameters A head request is agnostic from the format since no body input/output format is considered the output is built based on http headers
func (*Client) Patch ¶
Patch ... Overridable HTTP method patch an entity using route as base url
func (*Client) Perform ¶
func (r *Client) Perform( ctx context.Context, verb string, route string, params url.Values, input interface{}, output interface{}, format string, ) error
Perform ...