What HTTP Status Codes Should Programmers be Concerned With?

前端 未结 6 1894
半阙折子戏
半阙折子戏 2021-02-03 11:06

So, if you look at the List of HTTP Status Codes, there are probably a number of them that would be useful while programming. The server might handle some things, like protocols

6条回答
  •  甜味超标
    2021-02-03 11:36

    The ones I've used most are:

    • 301 - Moved Permanently - Use this if the resource is permanently moved to the new url.
    • 302 - Moved Temporarily - Use this for redirecting when you can't have a permanent redirect.
    • 404 - Not Found. Your server should be configured to serve this for invalid urls. You should monitor these in your logs--too many 404s is a sign of a bad push.
    • 500 - Internal Server Error. Your server should be configured to properly send these when there are errors. You should monitor 5xx errors in your logs.

提交回复
热议问题