Documentation ¶
Index ¶
- func BuildBasicAuthHeader(username string, password string) string
- type RestHelper
- func (h *RestHelper) SendRequest(endpointName string, method string, params *url.Values, payload interface{}) ([]byte, error)
- func (h *RestHelper) SendRequestToURL(url string, method string, params *url.Values, payload interface{}) ([]byte, error)
- func (h *RestHelper) SendRequestToURLWithRetry(url string, method string, params *url.Values, payload interface{}, ...) ([]byte, error)
- func (h *RestHelper) SendRequestWithRetry(endpointName string, method string, params *url.Values, payload interface{}, ...) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBasicAuthHeader ¶
BuildBasicAuthHeader builds an auth header needed for Basic Authentication
Types ¶
type RestHelper ¶
type RestHelper struct {
// contains filtered or unexported fields
}
RestHelper provides an easy interface to send requests to a REST endpoint
func NewRestHelper ¶
func NewRestHelper(baseURL string, authorizationHeader string) *RestHelper
NewRestHelper returns an instance of RestHelper
func NewRestHelperWithTimeout ¶
func NewRestHelperWithTimeout(baseURL string, authorizationHeader string, timeout time.Duration) *RestHelper
func (*RestHelper) SendRequest ¶
func (h *RestHelper) SendRequest(endpointName string, method string, params *url.Values, payload interface{}) ([]byte, error)
SendRequest generates an HTTP request to the REST endpoint
func (*RestHelper) SendRequestToURL ¶
func (h *RestHelper) SendRequestToURL(url string, method string, params *url.Values, payload interface{}) ([]byte, error)
SendRequestToURL generates an HTTP request to the given URL.
Click to show internal directories.
Click to hide internal directories.