这个阿里云 OpenAPI问题怎么解决?请求路径 http://vpc.aliyuncs.com/
请求体{"body":{"SignatureVersion":"1.0","Action":"CreateVpc","Format":"JSON","SignatureNonce":"0.9732621737077863","Version":"2016-04-28","AccessKeyId":"*","Signature":"o2GEaLA0Czvm9vEc6F//LdKWtyU=","CidrBlock":"192.168.0.0/16","SignatureMethod":"HMAC-SHA1","VpcName":"testvpc0908","RegionId":"cn-shanghai-finance-1","Timestamp":"2023-09-08T06:51:27Z"},"headers":{"Content-Type":["application/json","application/x-www-form-urlencoded"]}}
出错信息:{"message":"I/O error on POST request for \"http://vpc.aliyuncs.com/\": 状态码:400,异常信息:<?xml version='1.0' encoding='UTF-8'?>2D46BD44-FA62-5038-AA02-87216C2146B1vpc.aliyuncs.comInvalidVersion
Specified parameter Version is not valid.![CDATA[https://api.aliyun.com/troubleshoot?q=InvalidVersion&product=Vpc]]; nested exception is java.io.IOException: 状态码:400,异常信息:<?xml version='1.0' encoding='UTF-8'?>2D46BD44-FA62-5038-AA02-87216C2146B1vpc.aliyuncs.comInvalidVersion
Specified parameter Version is not valid.![CDATA[https://api.aliyun.com/troubleshoot?q=InvalidVersion&product=Vpc]]","responseCode":400}
"Content-Type": "application/json;application/x-www-form-urlencoded" 没那么复杂 先拼出url 然后把query里的数据 放到 表单就好。你这个contenttype是不对的 正确的就是application/x-www-form-urlencoded 此回答整理自钉群“阿里云 OpenAPI SDK 自签名服务群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。