美文网首页
数据库操作结果映射 http 状态码

数据库操作结果映射 http 状态码

作者: 萧哈哈 | 来源:发表于2018-08-25 08:42 被阅读27次

出自

DB Basic Operations

Create

  • Successfully returns 201 + body { Record } + location header field + /{id} to locate it
  • Already Exits returns 409 + body { statusCode: 409 , message: ‘Resource with ID xx already exists, couldn't create’ }
  • General returns 500 + body { statusCode:500, message: ‘juggler original message’ }

Read

  • Successfully returns 200 + body { Record }
  • Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found’ }
  • General returns 500 + body { statusCode:500, message: ‘juggler original message’ }

Update

  • Successfully returns 200 + body { Record }
  • Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found, couldn't update' }
  • General returns 500 + body { statusCode:500, message: ‘juggler original message’ }

Delete

  • Successfully returns 200 + body { Record }
  • Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found, couldn’t delete' }
  • General returns 500 + body { statusCode:500, message: ‘juggler original message’ }

Notes
1- { Record } is the full record, and behaves similar to the current insert operation in that it returns the defined record in the model.
2- statusCode is evaluated internally today and that’s the number placed in the http status header
3- 201 In the insert should also include A Location Header field with /newlycreatedID appended

相关文章

  • 数据库操作结果映射 http 状态码

    出自 DB Basic Operations Create Successfully returns 201 + ...

  • 图解HTTP解析5(状态码与通信数据名词)

    一、状态码 HTTP响应报文的响应行会返回HTTP状态码,这些状态码代表HTTP请求的返回结果。标记客户端是否处理...

  • HTTP状态码

    HTTP状态码: HTTP状态码有以下类型:1** 服务器收到请求,需要请求者继续执行操作。2** 成功,操作被成...

  • http状态码

    http状态码 http状态码是描述返回的请求结果,由3位数字和原因短语组成。 类别 | 状态码 | 类别 | 原...

  • 2.HTTP状态码/web服务器/HTTP首部

    HTTP状态码 状态码职责描述返回的请求结果 1** | informationl(信息状态码) | 接受的请求正...

  • 返回结果的HTTP状态码

    返回结果的HTTP状态码 HTTP状态码负责表示客户端HTTP请求的返回结果、标记服务器端的处理是否正常、通知出现...

  • HTTP状态码

    作者:李成文;标签: HTTP状态码 HTTP状态码的职责是当客户端发送请求时,描述返回的请求结果。通过状态码可以...

  • http状态码

    本篇关于http状态码 目录 http状态码分类 HTTP状态码列表 备注 http状态码分类 HTTP状态码列表 备注

  • Python 资源大全(三)

    目录: HTTP的库Python实现的数据库。用来连接和操作数据库的库实现对象关系映射或数据映射技术的库(ORM)...

  • http状态码书目录

    http状态码之100 http状态码之101 http状态码之102 http状态码之200 http状态码之2...

网友评论

      本文标题:数据库操作结果映射 http 状态码

      本文链接:https://www.haomeiwen.com/subject/puuwiftx.html