Add http status code and error contents to response body

Hey eveyone,

I want to add the contents and messages of the status code to the response body when the HTTP status code is 400 or 500.
Is it possible to realize it using the function of Kong?
Version of Kong uses 1.0.2.

HTTP 400 error → “apigw_error_code”: “E400000”, “apigw_error_message”: Missing required request parameters: [(parameter name)] "

HTTP 504 error → “apigw_error_code”: “E504000”, “apigw_error_message”: Endpoint request timed out

Thanks a lot for your help.

1 Like