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

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.
主站蜘蛛池模板: 琼结县| 南宫市| 乌鲁木齐市| 金乡县| 怀远县| 理塘县| 密山市| 驻马店市| 固阳县| 砀山县| 工布江达县| 闵行区| 万载县| 鄱阳县| 衡阳县| 贺州市| 邻水| 西林县| 丰都县| 阿克苏市| 玉屏| 乳源| 广元市| 宜都市| 榆社县| 清水河县| 龙海市| 丰宁| 东兴市| 桦南县| 隆林| 纳雍县| 府谷县| 资溪县| 班玛县| 靖西县| 抚宁县| 县级市| 三门县| 江都市| 屏东县|