xmlhttprequest - Which Http Status code to return when user provided data fails validation in Web Service? -
When the user enters the data and submits that data, then we use the XML server and XMLHttpRequest . But, if this data fails to verify, then we will have to return the 400 status status code. I thought the appropriate code would be 403. However, my associate does not agree but I do not know who to use.
Which would you use?
Thank you!
400 will be more correct, i.e. contains invalid data in the request 403 will be a mistake of acceptance of any kind , That the request was well made and correct but action was not allowed. If I was writing code to use a web service and I get a 403 error then it would never be for me because it was sending invalid data, it would be really confusing.
Comments
Post a Comment