-1

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?

Prithvi
  • 1
  • 2

1 Answers1

0

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.

Jinesi Yelizati
  • 271
  • 1
  • 7