开发语言:golang
环境:已经验证过下载证书的接口,签名的部分是没有问题的
验签失败返回信息:
{"code":"SIGN_ERROR","detail":{"detail":{"issue":"sign not match"},"field":"signature","location":"authorization","sign_information":{"method":"POST","sign_message_length":76,"truncated_sign_message":"POST\n/v3/merchant/media/upload\n1583330550\nFBBD6P84OE7UT4QRTTEBIWAR77S63DON\n\n","url":"/v3/merchant/media/upload"}},"message":"错误的签名,验签失败"}
签名字符串:
请求头信息:
header: map[
Accept:[application/json]
Authorization:[WECHATPAY2-SHA256-RSA2048 mchid="1551027311",nonce_str="FBBD6P84OE7UT4QRTTEBIWAR77S63DON",signature="TShejIcGe92nrXCx1Z9MQRNaipCbY2EvSJX5aB5lMOk+k+ForhpNuQqXC7zAg0AtCHHardwB3LEHDwmASFtsVMkX2j9BYS2dyBFFsKV3Ijr4cjdYyXVVNW0WcigbQmL+l/vENRecAjaR9roCOgdlSbgH0UVZ3b0GvPHxM332Hf3xo2j6bam/WScWnFlq17EugHPk5Tt9VY174KkZa4DmQNkwR1DK2z/OQ8rVnTqFdwJ7p1poRDBIXRZ0mU7eVRwmc8sZqW82l/TPiDdAN7EkAdsvjPAMHlrmOa5c1VgUBmKtZmKudYBpK9mXdUypWFDrDgoOmIzbw6R95p2edcDeXQ==",timestamp="1583330077",serial_no="1FBF8E58E92E1BC0D35B2687B6B61C262196EDCD"]
Content-Type:[multipart/form-data;boundary="boundary"]
User-Agent:[Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1]
]
请求body前半部分:
请求body后半部分:
参照这个写就行了。
其中io.Copy传入文件内容
可以的话,接口多添加一下golang的案例吧,给兄弟们留点头发!!!