Hi and welcome back.
In our previous lecture, we talked about what a server is,
how it serves as a central hub for storing and sharing data.
Now we will dive into another essential
aspect of software development, which is APIs.
API stands for application Programming Interface.
An API is a set of protocols, routines,
and tools for building software applications.
And simply put, it defines how different software component should interact
with each other.
In the context of mobile app and server communication.
APIs are used to allow the mobile app
to communicate with the server and access
data and functionality
provided by the server.
When a mobile app wants to retrieve data or perform an action on the server,
it sends a request through the API and the server responds with the requested data.
In addition to defining the interactions between the mobile app and server,
APIs also require different types of requests to be made.
These requests are typically categorized
as get, post, put and delete.
A Get request is used to retrieve data from the server.
For example, if we want to retrieve
information about specific book, we would make a get request to the server
through the API asking for the book information.
A post request is used to send data to the server.
For example, if we wanted to add a new book to the database,
we would make a post request to the server, send the information about
the new book, and create this new book using the server.
A put request is used to update existing data on the server.
For example, if we wanted to change
the price of a book, we would make a put request to the server
through the API sending the updated book data.
And a delete request is something
that you probably could guess already.
It would remove data from the server.
And for example, if we wanted to delete
a book from the database,
we would make delete requests
to the server through the API, specifying which book to delete.
Now that we understand what an API is, how it works, and the different types
of requests that APIs use, we can move on to the practical side of things.
In this section, we will be learning how to create APIs using NodeJS and Express.
We'll learn how to handle different types
of requests and use them to retrieve, add, update and delete data from the server.
By the end of this section, you'll have the skills necessary to build
robust, scalable APIs for your mobile app and server communication.
Thanks so much for watching, and I'll see you in the next video.