官术网_书友最值得收藏!

2xx – success

The variations of 2xx status codes, which represent success scenarios, can be compressed into four main 2xx status codes:

  • 200 OK: This is the most common happy path response, indicating that the request succeeded.
  • 201 Created: This indicates that a new resource has been successfully created. It is most commonly used as a response to POST request methods. This response should contain a location header, which provides the URL for the new resource that has been created. There is a recommendation to send the response body back with the newly created resource. Essentially, the response body is the same if the consumer hits the GET endpoint to retrieve the resource.
  • 202 Accepted: This is kind of equivalent to 201. The only difference is that 202 is used for asynchronous operations, as it clearly indicates eventual consistency.
  • 204 No Content: This is also similar to 200, but only when there is no response body. This is mostly used for DELETE requests.
主站蜘蛛池模板: 财经| 葵青区| 阿巴嘎旗| 通许县| 信宜市| 浦北县| 台湾省| 凤台县| 清河县| 和田市| 日喀则市| 清新县| 襄汾县| 崇左市| 金山区| 周至县| 漳州市| 昂仁县| 宝清县| 富民县| 将乐县| 巴林右旗| 临夏市| 潼关县| 彭州市| 辛集市| 遂昌县| 陆丰市| 鸡东县| 连江县| 清远市| 吉首市| 确山县| 柳州市| 喀喇| 容城县| 兴山县| 万盛区| 丹棱县| 南江县| 上思县|