【问题标题】:AWS API Gateway Javascript SDK Returns 404 Not FoundAWS API Gateway Javascript SDK 返回 404 Not Found
【发布时间】:2016-02-29 02:27:45
【问题描述】:

当我从 JavaScript 客户端调用我的 AWS API Gateway 时,我收到 404 not found 错误,因为 SDK 调用了错误的端点:

代替

昨天还好。有人可以解释原因吗?

更新!

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

【问题讨论】:

  • 我的 JavaScript 客户端驻留在我的服务器上(例如 myserver.com

标签: aws-api-gateway


【解决方案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);
      }

...

【讨论】:

    【解决方案2】:

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

    最好, 于尔根

    【讨论】:

      猜你喜欢
      • 2020-01-28
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      • 1970-01-01
      • 2021-09-11
      • 2023-03-05
      • 2021-06-03
      • 1970-01-01
      相关资源
      最近更新 更多