📜  代码响应 api - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:26.205000             🧑  作者: Mango

代码示例1
A duplicate in the database should be a 409 CONFLICT.
I recommend using 422 UNPROCESSABLE ENTITY for validation errors.

Google always returns 200 as status code in their Geocoding API, even if the request logically fails: https://developers.google.com/maps/documentation/geocoding/intro#StatusCodes

Facebook always return 200 for successful HTTP requests, even if REST request fails: https://developers.facebook.com/docs/graph-api/using-graph-api/error-handling

It's simple, HTTP status codes are for HTTP requests. REST API is Your, define Your status codes.