HTTP status code details

No sound tonight 2020-11-12 23:01:33
http status code details


Preface

I think people who are on the Internet now , It's impossible not to see such a thing , It's when the browser enters a web page , Sometimes the web page will give you an error , For example, the error shown in the figure below :

And the picture shows 404 That's what the browser of the web page we visited returned HTTP Status code , So HTTP The status code will appear in our online process , It's an integral part of the Internet , And learn well HTTP Status codes are very helpful for us to understand the Internet .

What is? HTTP Status code

First of all, let's explain HTTP What is the status code ,HTTP Status code ( English :HTTP Status Code) Is used to indicate the response status of hypertext transfer protocol of web server 3 Digit code .

So we can know HTTP The status code is from 3 Digit code shows , And it's The first number represents the type of response , The last two have no classification function .

that HTTP What's the use of status codes ?

When we ask to visit a website , Our browser will send a request to the server of the website . After receiving the request, the server will send a message containing HTTP The header of the status code , To respond to browser requests , And browsers use HTTP State code to determine what to do next , So we can use HTTP Status code to understand the current Web Server health .

HTTP Classification of status codes

After understanding what is HTTP After the status code , We need to HTTP Status code for a classification ,HTTP State codes can be generally divided into five categories :

type Type specification
100-199 The accepted request is being processed
200-299 The request is processed normally
300-399 Additional operations are required to complete the request
400-499 Client request error , The server was unable to process the request
500-599 Server processing request error

Various types HTTP Description of the status code

100-199 The status code :

Code Code instructions
100 The requester shall continue to make the request . If the server returns this code, it means , The server has received the first part of the request , Waiting to receive the rest .
101 Requestor has requested server to switch protocol , The server has confirmed and is ready to switch .

200-299 The status code

Code Code instructions
200 The server has successfully processed the request . Usually , This means that the server provides the requested web page . If your robots.txt The file shows this status , that , This means Googlebot The file has been retrieved successfully .
201 The request was successful and the server has created a new resource .
202 The server has accepted the request , But it hasn't been dealt with yet .
203 The server has successfully processed the request , But returned information that might have come from another source .
204 The server successfully processed the request , But nothing was returned .
205 The server successfully processed the request , But nothing was returned . And 204 Different response , This response requires the requester to reset the document view ( For example, clear form content to enter new content ).
206 Server successfully processed part GET request .

300-399 The status code

Code Code instructions
300 The server can perform a variety of operations on request . The server can (User agent) To select an operation , Or provide a list of actions for the requester to select .
301 The requested page has been permanently moved to a new location . The server returned this response ( As a pair of GET or HEAD Response to the request ) when , The requester is automatically moved to a new location . You should use this code to notify Googlebot A page or website has been permanently moved to a new location .
302 The request is responding from a different location on the web page , But the requester should continue to use the original location for future requests . This code and response GET and HEAD Requested 301 Code similarity , Will automatically move the requester to a different location . But because of Googlebot Will continue to grab the original location and index it , So you should not use this code to notify Googlebot A page or website has been moved .
303 When the requester should make a separate GET When requesting to retrieve a response , The server will return this code . For addition HEAD All requests except requests , The server will automatically go to another location .
304 Since last request , The requested page has not been modified . When the server returns this response , Page content will not be returned . If the page has not changed since the requester last requested , You should configure the server to return this response ( be called If-Modified-Since HTTP header ). Because the server can tell Googlebot The page has not changed since the last time it was crawled , So you can save bandwidth and overhead .
305 The requester can only use a proxy to access the requested web page . If the server returns this response , that , The server also indicates the proxy that the requester should use .
307 The request is responding from a different location on the web page , But the requester should continue to use the original location for future requests . This code and response GET and HEAD Requested 301 Code similarity , Will automatically move the requester to a different location . But because of Googlebot Will continue to grab the original location and index it , So you should not use this code to notify Googlebot A page or website has been moved .

400-499 The status code

Code Code instructions
400 The server does not understand the syntax of the request .
401 Request for authentication . After logging in , The server may return this response to the page .
403 Server rejects request . If in Googlebot Show this status code when trying to grab a valid page on your site ( You can go to Google See this status code on the network capture page under diagnosis in Webmaster tool ), that , This could be a denial by your server or host Googlebot Visit it .
404 The server could not find the requested page . for example , If the request is for a web page that does not exist on the server , that , The server usually returns this code . If you don't have robots.txt file , And you are Google Webmaster Tools " The diagnosis " Labeled robots.txt This state was found on the page , that , This is the right state . However , If you have robots.txt The document found this state again , that , This means your robots.txt The file may be named incorrectly or in the wrong location .( The file should be on the top-level domain name , And it should be called robots.txt). If you are in Googlebot This status is found on the URL you are trying to crawl ( be located " The diagnosis " Labeled HTTP On the error page ), that , This means Googlebot What you're tracking may be an invalid link in another page ( Old links or links with incorrect input ).
405 Disable the method specified in the request .
406 Unable to use the requested content feature to respond to the requested page .
407 This status code and 401( unauthorized ) similar , But it specifies that the requester should use a proxy to authorize . If the server returns this response , that , The server also indicates the proxy that the requester should use .
408 The server timed out waiting for a request .
409 Server conflicts when completing request . The server must contain information about conflicts in the response . The server is responding to a conflict with the previous request PUT This code may be returned on request , A list of the differences between the two requests is also provided .
410 If the requested resource has been permanently deleted , that , The server will return this response . The code is associated with 404( Not found ) Code similarity , But in the case of resources that existed before but no longer exist , Sometimes it can replace 404 Code appears . If the resource has been permanently deleted , that , You should use 301 The code specifies the new location of the resource .
411 The server will not accept requests with invalid content length header fields .
412 The server does not meet one of the prerequisites set by the requester in the request .
413 The server was unable to process the request , Because the request entity is too large , The processing power of the server has been exceeded .
414 Requested URI( Usually web address ) Too long , The server is unable to process .
415 The requested format is not supported by the requested page .
416 If the request is for an invalid range of pages , that , The server will return this status code .
417 Server not satisfied " expect " Request header field requirements .

500-599 The status code

Code Code instructions
500 Server encountered an error , Unable to complete request .
501 The server does not have the function to complete the request . for example , When the server does not recognize the request method , The server may return this code .
502 Server as gateway or proxy , Invalid response received from upstream server .
503 Unable to use server ( Due to overload or shutdown maintenance ). Usually , It's just a temporary state .
504 Server as gateway or proxy , Failed to receive request from upstream server in time .
505 The server does not support HTTP Protocol version .

ending

HTTP So much for the status code , In the future, the Internet will become more complex , There are bound to be more status codes , But that's what happened , Thank you for watching .

版权声明
本文为[No sound tonight]所创,转载请带上原文链接,感谢

  1. [front end -- JavaScript] knowledge point (IV) -- memory leakage in the project (I)
  2. This mechanism in JS
  3. Vue 3.0 source code learning 1 --- rendering process of components
  4. Learning the realization of canvas and simple drawing
  5. gin里获取http请求过来的参数
  6. vue3的新特性
  7. Get the parameters from HTTP request in gin
  8. New features of vue3
  9. vue-cli 引入腾讯地图(最新 api,rocketmq原理面试
  10. Vue 学习笔记(3,免费Java高级工程师学习资源
  11. Vue 学习笔记(2,Java编程视频教程
  12. Vue cli introduces Tencent maps (the latest API, rocketmq)
  13. Vue learning notes (3, free Java senior engineer learning resources)
  14. Vue learning notes (2, Java programming video tutorial)
  15. 【Vue】—props属性
  16. 【Vue】—创建组件
  17. [Vue] - props attribute
  18. [Vue] - create component
  19. 浅谈vue响应式原理及发布订阅模式和观察者模式
  20. On Vue responsive principle, publish subscribe mode and observer mode
  21. 浅谈vue响应式原理及发布订阅模式和观察者模式
  22. On Vue responsive principle, publish subscribe mode and observer mode
  23. Xiaobai can understand it. It only takes 4 steps to solve the problem of Vue keep alive cache component
  24. Publish, subscribe and observer of design patterns
  25. Summary of common content added in ES6 + (II)
  26. No.8 Vue element admin learning (III) vuex learning and login method analysis
  27. Write a mini webpack project construction tool
  28. Shopping cart (front-end static page preparation)
  29. Introduction to the fluent platform
  30. Webpack5 cache
  31. The difference between drop-down box select option and datalist
  32. CSS review (III)
  33. Node.js学习笔记【七】
  34. Node.js learning notes [VII]
  35. Vue Router根据后台数据加载不同的组件(思考->实现->不止于实现)
  36. Vue router loads different components according to background data (thinking - & gt; Implementation - & gt; (more than implementation)
  37. 【JQuery框架,Java编程教程视频下载
  38. [jQuery framework, Java programming tutorial video download
  39. Vue Router根据后台数据加载不同的组件(思考->实现->不止于实现)
  40. Vue router loads different components according to background data (thinking - & gt; Implementation - & gt; (more than implementation)
  41. 【Vue,阿里P8大佬亲自教你
  42. 【Vue基础知识总结 5,字节跳动算法工程师面试经验
  43. [Vue, Ali P8 teaches you personally
  44. [Vue basic knowledge summary 5. Interview experience of byte beating Algorithm Engineer
  45. 【问题记录】- 谷歌浏览器 Html生成PDF
  46. [problem record] - PDF generated by Google browser HTML
  47. 【问题记录】- 谷歌浏览器 Html生成PDF
  48. [problem record] - PDF generated by Google browser HTML
  49. 【JavaScript】查漏补缺 —数组中reduce()方法
  50. [JavaScript] leak checking and defect filling - reduce() method in array
  51. 【重识 HTML (3),350道Java面试真题分享
  52. 【重识 HTML (2),Java并发编程必会的多线程你竟然还不会
  53. 【重识 HTML (1),二本Java小菜鸟4面字节跳动被秒成渣渣
  54. [re recognize HTML (3) and share 350 real Java interview questions
  55. [re recognize HTML (2). Multithreading is a must for Java Concurrent Programming. How dare you not
  56. [re recognize HTML (1), two Java rookies' 4-sided bytes beat and become slag in seconds
  57. 【重识 HTML ,nginx面试题阿里
  58. 【重识 HTML (4),ELK原来这么简单
  59. [re recognize HTML, nginx interview questions]
  60. [re recognize HTML (4). Elk is so simple