Documentation ¶
Index ¶
- Variables
- func AesDecrypt(src, key []byte) (dst []byte, err error)
- func AesEncrypt(src []byte, key []byte) ([]byte, error)
- func GetBody(uri string) ([]byte, error)
- func GetFile(filename, uri string) error
- func GetJson(uri string, v interface{}) error
- func GetXml(uri string, v interface{}) error
- func PKCS7Pad(msg []byte, blockSize int) []byte
- func PKCS7UnPad(msg []byte) []byte
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostJson(uri string, obj interface{}) ([]byte, error)
- func PostJsonPtr(uri string, obj interface{}, result interface{}, contentType ...string) (err error)
- func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
- func PostXmlPtr(uri string, obj interface{}, result interface{}) (err error)
- func SetTimeOut(d time.Duration)
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeOut time.Duration = 60 * time.Second
TimeOut 请求超时设置,默认1分钟
Functions ¶
func AesDecrypt ¶
AesDecrypt AES-CBC解密,PKCS#7,传入密文和密钥,[]byte
func AesEncrypt ¶
AesEncrypt AES-CBC加密+PKCS#7打包,传入明文和密钥
func PostJsonPtr ¶
func PostJsonPtr(uri string, obj interface{}, result interface{}, contentType ...string) (err error)
PostJsonPtr 发送Json格式的POST请求并解析结果到result指针
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他表单数据
func PostXmlPtr ¶
PostXmlPtr 发送Xml格式的POST请求并解析结果到result指针
func SetTimeOut ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.