翻译自https://github.com/richzw/http-api-design Foundations Require TLSVersion with Accepts headerSupport caching with EtagsTrace requests with Request-IdsPaginate with ranges Requests Return appropriate status codesProvide full resources where availableAccept serialized JSON in request bodiesUse consistent path formatsDowncase paths and attributesSupport non-id dereferencing for convenienceMinimize path nesting Responses Provide resource (UU)IDsProvide standard timestampsUse UTC times formatted in ISO8601Nest foreign key relationsGenerate structured errorsShow rate limit statusKeep JSON minified in all responses Artifacts Provide machine-readable JSON schemaProvide human-readable docsProvide executable examplesDescribe stability Todo list