Status code : 200
Actual Response: { "code":500, "error": "error inserting" } , { "code:201, "message": "created successfully" }
Is this a correct response or status code should be same as in response body?
Status code : 200
Actual Response: { "code":500, "error": "error inserting" } , { "code:201, "message": "created successfully" }
Is this a correct response or status code should be same as in response body?
If some kind of ingress gateway is used, the app can't return 500, otherwise, the ingress gateway will try to retry the request, so the status code is returned in the body.
You can use the custom header for the status code to comply with RESTFul API.