Documentation ¶
Index ¶
- func AddParamsToURL(originURL string, params *url.Values) (*url.URL, error)
- func BuildURLWithQueryParams(baseURL string, params map[string]string) (string, error)
- func Download(fileURL string, params *url.Values, headers map[string]string, filepath string, ...) (int64, error)
- func DownloadHander(resp http.ResponseWriter, reader io.Reader, filename string) error
- func DownloadHandler(resp http.ResponseWriter, reader io.Reader, filename string) error
- func Get(schemaHostPath string, params *url.Values, headers map[string]string, ...) ([]byte, error)
- func HandleResp(resp *http.Response, dst interface{}) ([]byte, error)
- func NewFormBody(params map[string]string, files []*FileInfo) (contentType string, body io.Reader, err error)
- func Post(schemaHostPath string, headers map[string]string, body io.Reader, ...) ([]byte, error)
- func WrapHTTPProxy(client *http.Client, proxyURL string, insecure bool) (*http.Client, error)
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddParamsToURL ¶ added in v0.7.8
AddParamsToURL ...
func BuildURLWithQueryParams ¶ added in v0.7.10
BuildURLWithQueryParams ...
func Download ¶ added in v0.7.7
func Download(fileURL string, params *url.Values, headers map[string]string, filepath string, timeout ...time.Duration) (int64, error)
Download ...
func DownloadHander ¶ added in v0.5.22
func DownloadHandler ¶ added in v0.7.7
func Get ¶
func Get(schemaHostPath string, params *url.Values, headers map[string]string, dst interface{}, timeout ...time.Duration) ([]byte, error)
Get Send a get request
func HandleResp ¶
HandleResp check http status code and unmarshal a response body
func NewFormBody ¶
func NewFormBody(params map[string]string, files []*FileInfo) (contentType string, body io.Reader, err error)
NewFormBody represent create a http form data request Parameters
params: represent fields files: represent update files
Types ¶
Click to show internal directories.
Click to hide internal directories.