|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/api-course/
课程评论:没有评论
Coursera 上的 API 课程:如何创建、测试和记录你的 API 本课程将为你解释什么是 API (Application Programming Interface)。API 是一种软件中间件,允许两个应用程序相互通信。无论是使用 Facebook、发送即时消息还是查询手机天气,你都在使用 API。 **API 的工作原理:** 当你使用手机应用程序时,该应用会连接到互联网并向服务器发送数据。服务器接收数据,进行解析、执行必要的操作,然后将结果传回你的手机。应用程序再解析这些数据,以可读的方式呈现给你。所有这些过程都通过 API 完成。 **餐厅类比:** 想象你在餐厅点餐。菜单是你选择的选项,厨房负责准备你的订单。但你需要一个中间人来传递你的订单并送回食物,这就是服务员。服务员扮演着 API 的角色,它接收你的请求(订单),传达给厨房(系统),然后将厨房的响应(食物)送回给你。 **实际案例:网上订机票** 当你通过在线旅行服务(如 Kayak 或 Expedia)预订机票时,该服务会与航空公司的 API 进行交互。即使你不直接使用航空公司网站,旅行服务也通过 API 查询航班信息、座位可用性和价格。API 就像一个“服务员”,它接收旅行服务的请求,从航空公司数据库获取信息,然后将结果返回给旅行服务,最终呈现给你。 本课程旨在帮助你理解 API 的概念,并有望在未来学习如何创建、测试和记录你自己的 API。
HelloIn this course we will explain what an API is.API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you're using an API.What exactly is an API? Finally learn for yourself in this helpful video from MuleSoft, the API experts.When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API.To explain this better, let us take a familiar example.Imagine you're sitting at a table in a restaurant with a menu of choices to order from. The kitchen is the part of the "system" that will prepare your order. What is missing is the critical link to communicate your order to the kitchen and deliver your food back to your table. That's where the waiter or API comes in. The waiter is the messenger - or API - that takes your request or order and tells the kitchen - the system - what to do. Then the waiter delivers the response back to you; in this case, it is the food.Here is a real-life API example. You may be familiar with the process of searching flights online. Just like the restaurant, you have a variety of options to choose from, including different cities, departure and return dates, and more. Let us imagine that you're booking you are flight on an airline website. You choose a departure city and date, a return city and date, cabin class, as well as other variables. In order to book your flight, you interact with the airline's website to access their database and see if any seats are available on those dates and what the costs might be.However, what if you are not using the airline's website--a channel that has direct access to the information? What if you are using an online travel service, such as Kayak or Expedia, which aggregates information from a number of airline databases?The travel service, in this case, interacts with the airline's API. The API is the interface that, like your helpful waiter, can be asked by that online travel service to get information from the airline's database to book seats, baggage options, etc. The API then takes the airline's response to your request and delivers it right back to the online travel service, which then shows you the most updated, relevant information.