用trans_to_acs_request转换对象后,get(URL)返回的签名URL signtrue是错误的
from aliyunsdkcore.client import AcsClient from aliyunsdkcore.request import CommonRequest client = AcsClient('xxx', 'xxxxxxxxx', 'cn-hangzhou') request = CommonRequest() request.trans_to_acs_request() signature_url = (request.get_url('cn-hangzhou','xxx', 'xxxxxxx'))
用这个 signature_url,用postman或别的客户端访问,提示错误:400 {"Code":"SignatureDoesNotMatch"} 无法用别的HTTP客户端使用
您要使用哪个产品的哪个API?
短信的 https://help.aliyun.com/document_detail/101414.html?spm=a2c4g.11186623.2.11.467039deJC2m5i action:SendSms
您好, 您可以根据示例链接进行调用, https://help.aliyun.com/document_detail/101414.html
此问题将关闭
问题的关键是签名,我是看你们包已经实现了签名,我只是想获取签名后的URL。。用自己的HTTP客户端去发送。。。 现在的问题是, request.trans_to_acs_request() request.get_url('cn-hangzhou','xxx', 'xxxxxxx') 这返回的URL和签名根本对不上。
您使用的aliyunsdkcore 的版本是? 您能把您调用的代码贴过来吗? 我这边测试是OK
使用pip install aliyun-python-sdk-core 安装
Successfully installed aliyun-python-sdk-core-2.13.7
代码:从阿里云demo里复制的,只是信息修改成自己的,只是最后没有执行 client.do_action(request)
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest
client = AcsClient('
request.trans_to_acs_request() sigure_url_result = request.get_url('cn-hangzhou','xxx', 'xxxxxxx')
sigure_url_result 拿到后,访问返回,错误码是: SignatureDoesNotMatch 原因: 签名(Signature)加密错误。 解决方案: 如果使用SDK调用接口,请注意accessKeyId和accessKeySecret字符串赋值正确。
目前签名解决办法是用其它github 2年前实现的加密,修改了一下通过了。。 话说你们的 httpclient 不能实现异步么,旦腾!
sorry , 目前没有实现异步. 我反馈下, 看能不能排期进行.