Question

HTTP 400 Bad Request or HTTP 500 Internal Server Error

  • 12 September 2022
  • 0 replies
  • 187 views

Userlevel 1
Badge +6

When calling a IFS REST-API with an incorrect formed JSON Payload, for example calling an attribute that is specified to allow a value with 5 characters and the value is sent with 10 characters or when when calling with wrong attribute name, you will get HTTP 500  Internal Server Error.

Shouldn’t the error be a HTTP 400 Bad Request? Since the request is malformed (incorrect attribute length or name). According to the standards for REST-APIs it should raise HTTP 400 or isn’t this type of errorneus request a request that should raise HTTP 400?

How can we distinguish a malformed request (as above) from a data error (an error raised from business logic) when both issues are raised as HTTP 500 Internal Server Error?


0 replies

Be the first to reply!

Reply