首页 文章

AWS API网关Javascript SDK返回404 Not Found

提问于
浏览
0

当我从JavaScript客户端调用我的AWS API网关时,我收到404未找到错误,因为SDK调用了错误的 endpoints :

代替

昨天天气很好 . 有人可以解释原因吗?

UPDATE!

在axios.standalone.js中,创建Microsoft.XMLHTTP ActiveX对象以发送请求 . data 参数的 url 成员设置为"https:abc123.execute-api.us-east-1.amazonaws.com/dev/status" . 请注意,开头没有斜杠 . JavaScript客户端的基本URL将插入到请求URL中 . 请帮忙!

2 回答

  • 0

    最近修复了JS SDK生成器的问题 . 请使用新生成的版本更新JS SDK .

    最好的,约根

  • 1

    修改axios.standalone.js

    module.exports = function xhrAdapter(resolve, reject, config) {
    
          // Temporary fix for missing // in config.url 
          if ((config.url.substr(0, 6) == "https:") && (config.url.substr(0, 8) != "https://")) {     
            config.url = "https://" + config.url.substr(6, config.url.length - 6);
          }
    
    ...
    

相关问题