我正在使用Google App Engine上的Quickstart for Cloud Endpoint框架。部署应用程序后,我尝试向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时,我得到了相同的错误消息。最后一个get_user_email接口在我授权并执行之后就可以正常工作了。
任何帮助都是最好的。
发布于 2017-02-05 17:47:27
事实证明,我输入的内容是一个验证错误:
ValidationError: Expected type <type 'unicode'> for field content, found (None, None) (type <type 'tuple'>)
在我放入预期的类型后,没有任何问题。
https://stackoverflow.com/questions/42018363
复制相似问题