Documentation
¶
Index ¶
- func HTTPGet(uri string) ([]byte, error)
- func HTTPGetContext(ctx context.Context, uri string) ([]byte, error)
- func HTTPPost(uri string, data string) ([]byte, error)
- func HTTPPostContext(ctx context.Context, uri string, data []byte, header map[string]string) ([]byte, error)
- func PostFile(fieldName, filename, uri string) ([]byte, error)
- func PostJSON(uri string, obj interface{}) ([]byte, error)
- func PostJSONWithRespContentType(uri string, obj interface{}) ([]byte, string, error)
- func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
- func PostXML(uri string, obj interface{}) ([]byte, error)
- func PostXMLWithTLS(uri string, obj interface{}, ca, key string) ([]byte, error)
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPGetContext ¶
HTTPGetContext get 请求
func HTTPPostContext ¶
func HTTPPostContext(ctx context.Context, uri string, data []byte, header map[string]string) ([]byte, error)
HTTPPostContext post 请求
func PostJSONWithRespContentType ¶
PostJSONWithRespContentType post json数据请求,且返回数据类型
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
Types ¶
Click to show internal directories.
Click to hide internal directories.