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 string) ([]byte, error)
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostJSON(uri string, obj interface{}) ([]byte, error)
- func PostJSONWithBasicAuth(uri string, username string, password 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)
- func PutJSONWithBasicAuth(uri string, username string, password string, obj interface{}) ([]byte, error)
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPGetContext ¶
HTTPGetContext get 请求
func HTTPPostContext ¶
HTTPPostContext post 请求
func PostJSONWithBasicAuth ¶
func PostJSONWithBasicAuth(uri string, username string, password string, obj interface{}) ([]byte, error)
PostJSON post json 数据请求
func PostJSONWithRespContentType ¶
PostJSONWithRespContentType post json数据请求,且返回数据类型
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
func PostXMLWithTLS ¶
PostXMLWithTLS perform a HTTP/POST request with XML body and TLS
Types ¶
Click to show internal directories.
Click to hide internal directories.