Documentation ¶
Index ¶
- func PostFile(url, filename, filepath string) ([]byte, error)
- type HttpClient
- func (c *HttpClient) Delete(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
- func (c *HttpClient) Do(req *http.Request, v interface{}) (*http.Response, error)
- func (c *HttpClient) Get(path string, query interface{}, v interface{}, options RequestOptions) (*http.Response, error)
- func (c *HttpClient) NewRequest(method, reqPath string, params interface{}, options RequestOptions) (*http.Request, error)
- func (c *HttpClient) Post(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
- func (c *HttpClient) Put(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
- type RequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(baseUrl string) (*HttpClient, error)
func (*HttpClient) Delete ¶
func (c *HttpClient) Delete(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
func (*HttpClient) Get ¶
func (c *HttpClient) Get(path string, query interface{}, v interface{}, options RequestOptions) (*http.Response, error)
func (*HttpClient) NewRequest ¶
func (c *HttpClient) NewRequest(method, reqPath string, params interface{}, options RequestOptions) (*http.Request, error)
func (*HttpClient) Post ¶
func (c *HttpClient) Post(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
func (*HttpClient) Put ¶
func (c *HttpClient) Put(path string, body interface{}, v interface{}, options RequestOptions) (*http.Response, error)
type RequestOptions ¶
func (*RequestOptions) WithContext ¶
func (o *RequestOptions) WithContext(ctx context.Context)
func (*RequestOptions) WithHeader ¶
func (o *RequestOptions) WithHeader(name, value string)
func (*RequestOptions) WithHeaders ¶
func (o *RequestOptions) WithHeaders(headers map[string]string)
Click to show internal directories.
Click to hide internal directories.