【问题标题】:Request to Google Endpoints Quickstart API Fails with a 503对 Google Endpoints 快速入门 API 的请求失败并显示 503
【发布时间】:2017-02-03 06:51:22
【问题描述】:

我正在阅读 Google App Engine 上的 Cloud Endpoints Frameworks 快速入门。部署应用程序后,我尝试按照快速入门中所述向 API 发送请求:

curl -H "Content-Type: application/json" -X POST -d '{"content":"Hello world!"}' https://[my-app].appspot.com/_ah/api/echo/v1/echo

它返回以下错误消息:

{
 "error": {
  "code": 503,
  "errors": [
   {
    "domain": "global",
    "message": "Internal Server Error",
    "reason": "backendError"
   }
  ],
  "message": "Internal Server Error"
 }
}

endpoints-frameworks-v2/echo 示例中创建了 4 个 API。当我转到 API 资源管理器并尝试测试前 3 个 API 时,我收到了相同的错误消息。在我授权并执行后,最后一个 API get_user_email 按预期工作。

任何帮助都会很棒。

【问题讨论】:

  • 您是否尝试过在不使用 OAuth 的情况下执行前 3 种方法?示例中的那些方法没有任何 OAuth 配置(范围、受众等)。
  • 感谢您的建议。事实证明这是一个验证错误。

标签: google-app-engine curl google-cloud-endpoints google-apis-explorer


【解决方案1】:

结果是我输入的内容出现了验证错误:

ValidationError: Expected type <type 'unicode'> for field content, found (None, None) (type <type 'tuple'>)

我输入预期的类型后没有问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多