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

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.
主站蜘蛛池模板: 长兴县| 商南县| 永康市| 敖汉旗| 中山市| 萨迦县| 河东区| 灵山县| 安新县| 黑山县| 宕昌县| 兴业县| 河东区| 寻乌县| 广安市| 油尖旺区| 温州市| 加查县| 蕉岭县| 合肥市| 镇雄县| 修文县| 咸阳市| 乐东| 清河县| 德令哈市| 沁阳市| 洛川县| 彰武县| 中超| 新野县| 玉环县| 衢州市| 内乡县| 肇庆市| 凤山县| 德保县| 黄梅县| 望都县| 屏边| 襄垣县|