how can I use proxy+ to handle the root resource on api gateway to return body?

北城以北 提交于 2020-03-23 09:03:14

问题


API Gateway with proxy+ works fine for me, the only thing is that the root path always return "Missing Authentication Token", so I found I should setup "ANY" method for the root path, but it would return the response with header in json.

{
  "statusCode": 200,
  "body": "{\"message\":\"Welcome!\"}",
  "headers": {
    "x-powered-by": "Express",
    "access-control-allow-origin": "*",
    "content-type": "application/json; charset=utf-8",
    "content-length": "22",
    "etag": "W/\"16-XP9xOOkLTTczHdpNV2DV26X8ykM\"",
    "date": "Tue, 03 Mar 2020 01:15:05 GMT",
    "connection": "close"
  },
  "isBase64Encoded": false
}

how can I get return only the body?


回答1:


I found the solution, we could just use proxy when we setup the "get" (or "any") method on root.

if you have already setup the on the method, you update it on integration request



来源:https://stackoverflow.com/questions/60498809/how-can-i-use-proxy-to-handle-the-root-resource-on-api-gateway-to-return-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!