码迷,mamicode.com
首页 > Web开发 > 详细

[HTTP] Understand 2xx HTTP Status Code Responses

时间:2017-05-26 15:57:01      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:xpl   status   about   images   oca   ber   turn   add   specific   

The 2xx family of status codes are used in HTTP responses to indicate success. Beyond the generic 200 OK status code, there are a set of more specific success status codes that provide additional context or details about the specific nature of the successful request/response. We will explore the available success status codes, and what additional information they convey.

 

Difference between 201 and 202:

Both for post request, difference is 201 means successfully create new data on the server, it will return ‘Location‘ prop in the header.

技术分享

For 202, "Accepted", mean the request was accepted, but the data is not immedicatly available, there is no location prop:

技术分享

 

206: Partial content, it is useful when we want to continue downloading the file , it tells how many bytes has been downloaded, and the total number of bytes:

技术分享

[HTTP] Understand 2xx HTTP Status Code Responses

标签:xpl   status   about   images   oca   ber   turn   add   specific   

原文地址:http://www.cnblogs.com/Answer1215/p/6908715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!