Documentation ¶
Index ¶
- func ByteRequestBody(req *http.Request) (data []byte, err error)
- func ByteRequestBodyNoClose(req *http.Request) (data []byte, err error)
- func ByteResponseBody(resp *http.Response) (data []byte, err error)
- func StringRequestBody(req *http.Request) (string, error)
- func StringRequestBodyNoClose(req *http.Request) (string, error)
- func StringResponseBody(resp *http.Response) (string, error)
- type HttpClient
- func (s *HttpClient) Clear()
- func (s *HttpClient) Delete(uri string, data interface{}) (*http.Response, error)
- func (s *HttpClient) Get(uri string) (*http.Response, error)
- func (s *HttpClient) GetFile(uri string, filepath string) (*http.Response, error)
- func (s *HttpClient) Post(uri string, data []byte, header map[string][]string) (*http.Response, error)
- func (s *HttpClient) PostFile(uri string, filepath string) (*http.Response, error)
- func (s *HttpClient) PostForm(uri string, data map[string]string) (*http.Response, error)
- func (s *HttpClient) PostJSON(uri string, data interface{}) (*http.Response, error)
- func (s *HttpClient) Put(uri string, data interface{}) (*http.Response, error)
- func (s *HttpClient) SetHeader(key, value string) *HttpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteRequestBodyNoClose ¶
Types ¶
type HttpClient ¶
func NewHttpClient ¶
func NewHttpClient() *HttpClient
func NewHttpClientWithCAs ¶
func NewHttpClientWithCAs(cas ...string) *HttpClient
func (*HttpClient) Clear ¶
func (s *HttpClient) Clear()
func (*HttpClient) Delete ¶
func (s *HttpClient) Delete(uri string, data interface{}) (*http.Response, error)
func (*HttpClient) PostJSON ¶
func (s *HttpClient) PostJSON(uri string, data interface{}) (*http.Response, error)
func (*HttpClient) Put ¶
func (s *HttpClient) Put(uri string, data interface{}) (*http.Response, error)
func (*HttpClient) SetHeader ¶
func (s *HttpClient) SetHeader(key, value string) *HttpClient
Click to show internal directories.
Click to hide internal directories.