学习 API 基础和架构 —— 面向初学者的指南 - #658
Merged
Merged
Conversation
miyaliu666
reviewed
Sep 2, 2025
|
|
||
|
|
||
| This article is well-suited for beginners in web and mobile development and developers seeking a concise understanding of APIs and how they function. | ||
| 这篇文章非常适合于网络和移动开发初学者,以及希望简要了解 API 及其如何运作的开发者。 |
| 想象一下有一家餐馆:顾客(客户端)通过服务员(API)点餐,然后服务员通知厨房(服务器)。厨房备餐后通过服务员传递给顾客。就像服务员一样,API 处理请求和响应,让顾客在无需了解厨房操作细节的情况下享受餐点。 | ||
|
|
||
| A more practical example is when you buy a subscription online, and your payment information is securely sent to Paystack through its payment API. The API is a middleman that takes your request, verifies and processes your payment details with the bank, and then returns a confirmation to the website without directly exposing sensitive data. | ||
| 一个更实用的例子是当你在线购买订阅时,你的支付信息通过其支付 API 安全发送至 Paystack。API 是一个中间商,它获取你的请求,验证并处理你的银行支付信息,然后在不直接暴露敏感数据的情况下返回确认给网站。 |
| ### 开放 API | ||
|
|
||
| Open APIs are APIs made available to the general public. This encourages developers, organisations, and other people to use them to develop applications, integrate them into their services, and improve them. Open APIs provide standardised access to data or services over the Internet. | ||
| 开放 API 是向公众提供的 API。它鼓励开发者、组织和其他人使用它们来开发应用程序,将其集成到他们的服务中,并加以改进。开放 API 提供了通过互联网访问数据或服务的标准化接口。 |
| ``` | ||
|
|
||
| - Client receives and uses the data: The frontend or another service consumes the API response and displays or processes it accordingly. | ||
| - 客户端接收并使用数据:前端或其他服务消费 API 响应,并相应地显示或处理数据。 |
| - 客户端接收并使用数据:前端或其他服务消费 API 响应,并相应地显示或处理数据。 | ||
|
|
||
| Teams utilize REST APIs for web services, mobile apps, and cloud integrations. Social media platforms fetch posts, while e-commerce sites retrieve product details. Payment gateways process transactions and weather apps access real-time forecasts. REST’s simplicity and scalability make it the preferred choice for public and internal APIs. | ||
| 团队利用 REST APIs 用于 Web 服务、移动应用和云集成。社交媒体平台获取帖子,电子商务网站检索产品详情。支付网关处理交易,天气应用程序访问实时预测。REST 的简单性和可扩展性使其成为公共和内部 API 的首选。 |
Member
There was a problem hiding this comment.
团队将 REST API 用于 Web 服务、移动应用程序和云集成。
|
|
||
|
|
||
| Banks, healthcare providers, and government agencies use SOAP for secure, reliable APIs. Financial institutions process transactions with strict authentication, while healthcare systems exchange patient data under compliance regulations. Airlines rely on SOAP for booking and ticketing, ensuring consistent data integrity across systems. | ||
| 银行、医疗保健提供者和政府机构使用 SOAP 进行安全、可靠的 API。金融机构以严格的身份验证处理交易,而医疗系统在遵从法规下交换患者数据。航空公司依赖 SOAP 进行预订和售票,确保跨系统的一致数据完整性。 |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Update index.md)Closes #625