samedi 25 novembre 2017

What HTTP error should I return if client sends incorrect type of data to REST API?

Say I have a page that requests the user to send ID, and ID should be an Integer. If the user send an alphanumerical (or anything that doesn't fit Integer format), should I return 400 - Bad Request or 406 - Not Acceptable?




Aucun commentaire:

Enregistrer un commentaire