|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- > 正常响应
-
- ```
- {
- "version": "1.0.0.0",
- "code": 200,
- "message": "this is message",
- "isError": false,
- "data": {
- "id": 1,
- "name": "name",
- "age": 21
- }
- }
- ```
-
- > 异常响应
-
- ```
- {
- "version": "1.0.0.0",
- "code": 500,
- "isError": true,
- "responseException": {
- "exceptionMessage": "Unhandled Exception occurred. Unable to process the request."
- }
- }
- ```
-
- > 入参字段不符合要求响应
-
- ```
- {
- "version": "1.0.0.0",
- "code": 400,
- "isError": true,
- "responseException": {
- "exceptionMessage": "Request responded with one or more validation errors occurred.",
- "validationErrors": [
- {
- "name": "Name",
- "reason": "最大长度5"
- },
- {
- "name": "Location",
- "reason": "最大长度5"
- }
- ]
- }
- }
- ```
-
- # code状态码一栏表
-
- 状态码类型:
-
- - 1**:服务器收到,客户端继续操作
- - 2**:服务端处理成功
- - 3**:服务端重定向
- - 4**:客户端错误
- - 5**:服务端错误
-
- 状态码:
-
- - 200:服务端确认客户端请求成功,一般用于GET和POST请求
- - 201:服务端创建资源成功
- - 204:服务端没有内容返回
- - 404:客户端请求的资源不存在
- - 412:客户端先决条件错误
- - 413:客户端请求实体过大
- - 414:客户端请求URL过长
- - 415:客户端媒体格式不对
- - 419:客户端身份验证超时
- - 422:客户端实体验证失败
- - 429:客户端请求过多
- - 431:客户端请求头过大
- - 500:服务端内部错误
- - 501:服务端不支持的请求
- - 502:服务端收到来自远端的无效响应
- - 503:服务端无法处理客户端请求
- - 505:服务端不支持请求的HTTP协议版本
|