Documentation ¶
Index ¶
- type HTTPClient
- func (h *HTTPClient) BuildData(parameters map[string]string) string
- func (h *HTTPClient) Delete(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
- func (h *HTTPClient) Get(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
- func (h *HTTPClient) GetHeaderValue(response *http.Response, key string) string
- func (h *HTTPClient) GetStatusCode(response *http.Response) int
- func (h *HTTPClient) Patch(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) Post(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) Put(ctx context.Context, endpoint string, data string, ...) (*http.Response, error)
- func (h *HTTPClient) ToString(response *http.Response) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient struct
func NewHTTPClient ¶
func NewHTTPClient(timeout int) *HTTPClient
NewHTTPClient creates an instance of http client
func (*HTTPClient) BuildData ¶
func (h *HTTPClient) BuildData(parameters map[string]string) string
BuildData build body data
func (*HTTPClient) Delete ¶
func (h *HTTPClient) Delete(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
Delete http call
func (*HTTPClient) Get ¶
func (h *HTTPClient) Get(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)
Get http call
func (*HTTPClient) GetHeaderValue ¶
func (h *HTTPClient) GetHeaderValue(response *http.Response, key string) string
GetHeaderValue get response header value
func (*HTTPClient) GetStatusCode ¶
func (h *HTTPClient) GetStatusCode(response *http.Response) int
GetStatusCode response status code
func (*HTTPClient) Patch ¶
func (h *HTTPClient) Patch(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)
Patch http call
func (*HTTPClient) Post ¶
func (h *HTTPClient) Post(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)
Post http call
Click to show internal directories.
Click to hide internal directories.