René's URL Explorer Experiment


Title: GitHub - Highflyer/REST-API-Design-Guide

Open Graph Title: GitHub - Highflyer/REST-API-Design-Guide

X Title: GitHub - Highflyer/REST-API-Design-Guide

Description: Contribute to Highflyer/REST-API-Design-Guide development by creating an account on GitHub.

Open Graph Description: Contribute to Highflyer/REST-API-Design-Guide development by creating an account on GitHub.

X Description: Contribute to Highflyer/REST-API-Design-Guide development by creating an account on GitHub.

Opengraph URL: https://github.com/Highflyer/REST-API-Design-Guide

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:6d780df1-5992-1d79-c1b8-c144ff884d1d
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-idB5D6:14F335:753F904:9841D8A:697594CE
html-safe-nonce39191d081d63289eb7503a9eb9758bf8f1823bcaeb0927ef070bd4866dce4c3e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUQ2OjE0RjMzNTo3NTNGOTA0Ojk4NDFEOEE6Njk3NTk0Q0UiLCJ2aXNpdG9yX2lkIjoiODY2NDE4MTcwMjAwNTIwMDA3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac86da1d97e19e30e4e58b80271dc4c4277308b31010ff1cb06a23dba01e983b29
hovercard-subject-tagrepository:169051639
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location//
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/Highflyer/REST-API-Design-Guide
twitter:imagehttps://opengraph.githubassets.com/bca4193c582acc276ad56c4e80d26fb26c35916e3d8b8151994c095971edcbf3/Highflyer/REST-API-Design-Guide
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bca4193c582acc276ad56c4e80d26fb26c35916e3d8b8151994c095971edcbf3/Highflyer/REST-API-Design-Guide
og:image:altContribute to Highflyer/REST-API-Design-Guide development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/Highflyer/REST-API-Design-Guide git https://github.com/Highflyer/REST-API-Design-Guide.git
octolytics-dimension-user_id614030
octolytics-dimension-user_loginHighflyer
octolytics-dimension-repository_id169051639
octolytics-dimension-repository_nwoHighflyer/REST-API-Design-Guide
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id169051639
octolytics-dimension-repository_network_root_nwoHighflyer/REST-API-Design-Guide
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FHighflyer%2FREST-API-Design-Guide
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FHighflyer%2FREST-API-Design-Guide
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=Highflyer%2FREST-API-Design-Guide
Reloadhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Reloadhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Reloadhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Highflyer https://patch-diff.githubusercontent.com/Highflyer
REST-API-Design-Guidehttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FHighflyer%2FREST-API-Design-Guide
Fork 20 https://patch-diff.githubusercontent.com/login?return_to=%2FHighflyer%2FREST-API-Design-Guide
Star 99 https://patch-diff.githubusercontent.com/login?return_to=%2FHighflyer%2FREST-API-Design-Guide
99 stars https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/stargazers
20 forks https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/forks
Branches https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/branches
Tags https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/tags
Activity https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/activity
Star https://patch-diff.githubusercontent.com/login?return_to=%2FHighflyer%2FREST-API-Design-Guide
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FHighflyer%2FREST-API-Design-Guide
Code https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Issues 0 https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/issues
Pull requests 0 https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/pulls
Actions https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/actions
Projects 0 https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/projects
Security 0 https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/security
Insights https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/pulse
Code https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Issues https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/issues
Pull requests https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/pulls
Actions https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/actions
Projects https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/projects
Security https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/security
Insights https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/pulse
Brancheshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/branches
Tagshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/tags
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/branches
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/tags
42 Commitshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/commits/master/
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/commits/master/
README.mdhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/blob/master/README.md
README.mdhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/blob/master/README.md
READMEhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#rest-api-设计规范与最佳实践
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#目录
一、REST API 简介https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E4%B8%80rest-api-%E7%AE%80%E4%BB%8B
1.1 术语https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#11-%E6%9C%AF%E8%AF%AD
1.2 成熟度模型https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#12-%E6%88%90%E7%86%9F%E5%BA%A6%E6%A8%A1%E5%9E%8B
二、URL 设计https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E4%BA%8Curl-%E8%AE%BE%E8%AE%A1
2.1 一般约定https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#21-%E4%B8%80%E8%88%AC%E7%BA%A6%E5%AE%9A
2.2 动词 + 宾语https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#22-%E5%8A%A8%E8%AF%8D--%E5%AE%BE%E8%AF%AD
2.3 动词的覆盖https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#23-%E5%8A%A8%E8%AF%8D%E7%9A%84%E8%A6%86%E7%9B%96
2.4 宾语必须是名词https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#24-%E5%AE%BE%E8%AF%AD%E5%BF%85%E9%A1%BB%E6%98%AF%E5%90%8D%E8%AF%8D
2.5 使用复数做资源名称https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#25-%E4%BD%BF%E7%94%A8%E5%A4%8D%E6%95%B0%E5%81%9A%E8%B5%84%E6%BA%90%E5%90%8D%E7%A7%B0
2.6 避免多级 URLhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#26-%E9%81%BF%E5%85%8D%E5%A4%9A%E7%BA%A7-url
2.7 搜索、排序、筛选和分页https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#27-%E6%90%9C%E7%B4%A2%E6%8E%92%E5%BA%8F%E7%AD%9B%E9%80%89%E5%92%8C%E5%88%86%E9%A1%B5
三、HTTP 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E4%B8%89http-%E7%8A%B6%E6%80%81%E7%A0%81
3.1 始终使用精确的状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#31-%E5%A7%8B%E7%BB%88%E4%BD%BF%E7%94%A8%E7%B2%BE%E7%A1%AE%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81
3.2 2xx 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#32-2xx-%E7%8A%B6%E6%80%81%E7%A0%81
3.3 3xx 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#33-3xx-%E7%8A%B6%E6%80%81%E7%A0%81
3.4 4xx 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#34-4xx-%E7%8A%B6%E6%80%81%E7%A0%81
3.5 5xx 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#35-5xx-%E7%8A%B6%E6%80%81%E7%A0%81
四、服务器回应https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E5%9B%9B%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9B%9E%E5%BA%94
4.1 不要返回纯本文https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#41-%E4%B8%8D%E8%A6%81%E8%BF%94%E5%9B%9E%E7%BA%AF%E6%9C%AC%E6%96%87
4.2 发生错误时,不要返回 200 状态码https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#42-%E5%8F%91%E7%94%9F%E9%94%99%E8%AF%AF%E6%97%B6%E4%B8%8D%E8%A6%81%E8%BF%94%E5%9B%9E-200-%E7%8A%B6%E6%80%81%E7%A0%81
4.3 提供链接https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#43-%E6%8F%90%E4%BE%9B%E9%93%BE%E6%8E%A5
五、版本控制https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E4%BA%94%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6
六、参考链接https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#%E5%85%AD%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#一rest-api-简介
RESTfulhttps://en.wikipedia.org/wiki/Representational_state_transfer
Roy Fieldinghttps://en.wikipedia.org/wiki/Roy_Fielding
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#11-术语
HTTP Status Codehttps://en.wikipedia.org/wiki/List_of_HTTP_status_codes
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#12-成熟度模型
成熟度模型https://martinfowler.com/articles/richardsonMaturityModel.html
HATEOAS - Wikipediahttps://en.wikipedia.org/wiki/HATEOAS
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#二url-设计
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#21-一般约定
JSONhttps://en.wikipedia.org/wiki/JSON
JWThttps://jwt.io
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#22-动词--宾语
https://camo.githubusercontent.com/5e0852cedfb329a9ea1692b19a4307ce2cdd6416ac5e386cf4108a9dd6d5ab5c/68747470733a2f2f64726976652e676f6f676c652e636f6d2f66696c652f642f317278754b4c3435594c59362d6d6d5a624832716750532d714868324b694968762f766965773f7573703d73686172696e67
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#23-动词的覆盖
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#24-宾语必须是名词
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#25-使用复数做资源名称
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#26-避免多级-url
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#27-搜索排序筛选和分页
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#三http-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#31-始终使用精确的状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#32-2xx-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#33-3xx-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#34-4xx-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#35-5xx-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#四服务器回应
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#41-不要返回纯本文
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#42-发生错误时不要返回-200-状态码
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#43-提供链接
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#五版本控制
语义化版本控制规范https://semver.org/lang/zh-CN/#%E6%91%98%E8%A6%81
https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#六参考链接
API Designhttps://docs.microsoft.com/en-us/azure/architecture/best-practices/api-design
Microsoft REST API Guidelineshttps://github.com/Microsoft/api-guidelines
RESTful API Design: 13 Best Practices to Make Your Users Happyhttps://blog.florimondmanca.com/restful-api-design-13-best-practices-to-make-your-users-happy
RESTful API Designing Guidelines  —  The Best Practiceshttps://hackernoon.com/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9
⬆ 返回目录https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#rest-api-%E8%AE%BE%E8%AE%A1%E8%A7%84%E8%8C%83%E4%B8%8E%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5
Readme https://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide#readme-ov-file
Please reload this pagehttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide
Activityhttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/activity
99 starshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/stargazers
2 watchinghttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/watchers
20 forkshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/forks
Report repository https://patch-diff.githubusercontent.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2FHighflyer%2FREST-API-Design-Guide&report=Highflyer+%28user%29
Releaseshttps://patch-diff.githubusercontent.com/Highflyer/REST-API-Design-Guide/releases
Packages 0https://patch-diff.githubusercontent.com/users/Highflyer/packages?repo_name=REST-API-Design-Guide
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.