开发者社区> 问答> 正文

这个阿里云 OpenAPI问题怎么解决?

这个阿里云 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.comInvalidVersionSpecified 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.comInvalidVersionSpecified parameter Version is not valid.![CDATA[https://api.aliyun.com/troubleshoot?q=InvalidVersion&product=Vpc]]","responseCode":400}

展开
收起
三分钟热度的鱼 2023-09-12 21:25:37 29 0
1 条回答
写回答
取消 提交回答
  • "Content-Type": "application/json;application/x-www-form-urlencoded" 没那么复杂 先拼出url 然后把query里的数据 放到 表单就好。你这个contenttype是不对的 正确的就是application/x-www-form-urlencoded 此回答整理自钉群“阿里云 OpenAPI SDK 自签名服务群”

    2023-09-12 21:36:15
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
AutoTalk第七期:自动化工具-OpenAPI在线调试 立即下载
最大化阿里云OpenAPI能力的方法和实践 立即下载
低代码开发师(初级)实战教程 立即下载