响应错误的时,生成统一的、结构化的错误信息。包含一个机器可读的错误 id,一个人类能识别的错误信息(message),根据情况可以添加一个url来告诉客户端关于这个错误的更多信息以及如何去解决它,例如:HTTP/1.1 429 Too Many Requests{ "id": "rate_limit", "message": "Account reached its API rate limit.", "url": "https://docs.service.
一个大的响应应该通过多个请求使用Range头信息来拆分,并指定如何取得。详细的请求和响应的头信息(header),状态码(status code),范围(limit),排序(ordering)和迭代(iteration)等,参考Heroku Platform API discussion of Ranges。
, identifying the specificversion of the returned resource. The user should be able to check forstaleness in their subsequent requests by supplying the value in theIf-None-Match header.在所有的请求中带上 ETag 头 , 用于识别特定版本的返回资源。用户可以在随后的请求中通过提供 If-None-Match头的值来检查内容是否过期。