Hello,
I have a simple question. The business I am designing for has asked that if an invalid JSON is submitted to the API the status code returned not be 500.. They have stated that 500 raises all kinds of alarms for them. Is there a way to change this? I have coded errors to be 400 already but that does not affect the JSON being invalid.
Discussion posts and replies are publicly visible
You have to check the JSON first if it is valid then send the status code to 200 else 400. To set these value, you have to use httpResponse.