简体   繁体   中英

Does Api Gateway allow post request without request body

I have created and enpoint that has path param as id and using that it fetches data from db and then posts the data from database using http. I am using AWS ApiGateway to manage this endpoint however, when I pass the id and try to test the endpoint on api gateway without request body or some random valid request body, it shows:

"errors": [
        {
          "title": "Error in API Gateway",
          "code": "DEFAULT_5XX"
        }
      ]

It also shows the following in the logs:

Illegal character in path at index 101: http://example.local/orders/items/create/{id}

To answer your question, yes, we can do a POST on API Gateway without a body. The error is pretty clear, it is an illegal character in the path.

There is a post on AWS FAQ about this. The solution is to add a proxy path variable in the integration request pane such that it does not run any validation checking on this particular path of the path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM