Documentation ¶
Index ¶
- func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appID []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte)
- func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error)
- func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error)
- func GetCurrTs() int64
- func HTTPGet(uri string) ([]byte, error)
- func HTTPPost(uri string, data string) ([]byte, error)
- func MD5Sum(txt string) (sum string)
- func NewTLSHttpClient(certPEMBlock, keyPEMBlock []byte) (httpClient *http.Client, err error)
- func NewTLSHttpClientByFile(certFile, keyFile string) (httpClient *http.Client, err error)
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostFileV2(fieldname, filename string, fileReader io.Reader, uri string) (respBody []byte, err 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{}, client *http.Client) ([]byte, error)
- func RandomStr(length int) string
- func Signature(params ...string) string
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecryptMsg ¶
AESDecryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func AESEncryptMsg ¶
AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func DecryptMsg ¶
DecryptMsg 消息解密
func EncryptMsg ¶
EncryptMsg 加密消息
func NewTLSHttpClient ¶
func NewTLSHttpClientByFile ¶
NewHTTPSClient 获取默认https客户端
func PostFileV2 ¶
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.