tgoop.com/zeeprogrammer/2335
Last Update:
HTTP Status Codes versus Your Application
Remember that the HTTP status code is a code to indicate what is happening at the HTTP
level. It doesn't necessarily reflect what happened inside your application. For example, imagine
a user submits a sign-in form to the server, but didn't fill out the Last Name field. If your
application requires a last name it will fail to create an account for the user. This doesn't mean
you have to return an HTTP error code indicating failure. You probably want quite the opposite
to happen—you want to successfully return some content to the client with a 200 (OK) status
code. The content will tell the user a last name was not provided. From an application
perspective the request was a failure, but from an HTTP perspective the request was
successfully processed. This is normal in web applications.
#tips #programming #http
BY Tech Program
Share with your friend now:
tgoop.com/zeeprogrammer/2335