What is API? Highlights of API

Tram Ho

On the road to becoming a professional programmer, you must have heard of APIs. But what is an API ? Can I eat it? Or can you hold it? Let’s find out together in this article!

What is API?

API stands for Application Programming Interface – is an intermediate method used to connect applications with each other. The API provides access to a set of commonly used functions, which makes data exchange between applications more efficient.

Let’s go through a real-life example: When you go to eat at a restaurant, you pick up the menu to choose the dishes and tell the waiter the dishes you choose. At this time, the waiter will record the information and proceed to move into the kitchen, informing the chef what dishes need to be made. When the chef is done with the dish, the waiter will bring the dish to the table for you to enjoy. In this case you can interpret the server as an API.

Highlights of API

  • API uses open source code, used with any client that supports XML, JSON.
  • The API is capable of fully responding to HTTP components: uri, request/response, headers,…
  • Web API model used to support MVC such as: unit test, injection, ioc container, model binder, action result, filter, routing, controller. In addition, it also supports RESTful full methods such as: GET, POST, PUT, DELETE the data.
  • Rated as one of the architectural styles that best support devices with limited bandwidth such as smartphones, tablets, etc.

Advantages and disadvantages of APIs

Advantage

  • Connect all the time based on the internet.
  • Two-way communication must be confirmed in transactions. That’s why the information is so reliable.
  • Full RESTful functionality support.
  • Simple configuration, user-friendly.

Defect

  • Expensive to operate, develop and modify.
  • Requires in-depth knowledge.
  • There may be security issues when attacked.

Application of API

  • Web API: Is an API system used in website systems, such as: Google, Facebook… Most websites provide an API system that allows you to connect, get data or update a database.
  • APIs on the operating system: Windows or Linux has a lot of APIs. They provide API documents that specify functions, methods, and connection protocols.
  • Framework API: The API describes and specifies the desired actions that libraries provide. An API can have many different implementations, making it possible for a program written in one language to use a library written in another language.

summary

Above I have answered for you to understand what API is through practical examples as well as one and its characteristics. In fact API is a very important tool for every programmer so try not to ignore this knowledge. Good luck on your chosen programming path. Reference: https://www.thegioicode.com/2023/02/api-la-gi.html

Share the news now

Source : Viblo