Hello and welcome to the Goldens programming language course in the previous session, we were able
to make the configuration related to the server and set it up in this session.
The intent to send several rest end points from the client to the server.
To do these views, Postman's software.
But before do it, we should run the main method of the project by calling the main method the seven
is a starter.
And in the mode of listening to different requests to respond appropriately so first round the main
function go from.
There are two batches listening that go now server is running on the local on port 880.
Postman is an API development tool which helps to build, test and modify APIs.
Almost any functionality that could be needed by any developer is encapsulated in this tool.
It has the ability to make various types of HTP requests like it paused PWD patch saving environments
for later use, converting to API to code for various languages.
Before running to APIs inside Postman's software, he first entered the MySQL database and checked the
lists of student in person schema.
Go to the person schema.
Go to the tables and go to a student table.
Right click on it and select Ruth.
Now we can see we have five records here, John.
Linda, Jack, David and Mary now go to Restaurant five and check the created a.
Go to risk config.
OK, here we have created four different API one to select.
All this didn't want to select a student based on the name.
Want to create a new student and want to update the student information.
So in the Post Man program, we can use these four APIs as client side requests.
It's time to go to the postman to execute our rest API.
Click on the plus side and enter our request.
You are in text, then then select your metal, then execute the API.
Suppose we want to see first the list of all the students.
To do this, we need to call the API for selecting all the student.
So first click on the plus side and in text field.
We write our rest API for select all the students we write low crime.
Horst Köhler 880 is less rest, less API and is less the students.
Then the method defined for this API is gittes, so select get method from methods drop down.
By default, here is gittes and now send the request frontline. into the server.
Now we can see the output, we see all the students of student table by calling Rest API I one John
age 45 five, named Linda I the eight named Jack.
I did nine named David and I did 10 name Mary.
Do this again for another request in this case, you want to see a student base its name to do this.
We need to call the API for select a student based name.
So we write localhost call and 880 if this risk slash API slash student and slash its name, for example,
which
the method is get and press send button.
Now we can see the information of the Jack, a student I.D. eight named Jack and age 25.
Do this again for other requests.
In this case, we want to save in the Student two database to do this.
We need to call the API for save students, so click on the plus sign right?
Localhost Column 80 18.
Yes, less serious.
Less API and business is still there.
Is less at.
Select the body, tap below where to enter the API.
Then select the RO option and change its value from tax to Jason.
Now enter the information of the student in JSON format in the box below and send it to the server so
political process and initialize a student field between them.
Note that the idea value will be added automatically to the database.
So, for example, Killebrew says
me
the right came
and set a comma go to the next line, and for age we set, for example.
Thirty three.
And the method defined for this API is post, so select post method from Method dropdown post and send
the request front line to their server.
Now, go to the database and select all the students again ran the query again.
Now we can see the output.
We see that IMU, a student, has been added to the list.
13 name team and age 33.
Do this again for other requests now, go to the postman and continue,
in this case, we want to update and N'existe a student database to do this.
We need to calm the API for Update is student, so we write localhost column 88, a server IP address
that's raised as much API as Part Perfect's.
It's not a student, it's less added as Pat.
Now we want to update a student debt we inserted in the previous calling API.
So go to a database and see its I.D. The idea of the Kinney's 13 go to the post, meaning continuing.
We write.
I.D.
Caller 13.
And we want to change the name of it to Tom.
And the method defined for this API is so Celek post method from Methods dropdown and send the request
from Client into the server.
OK, now go to database and select all the students again.
Here we have I do 13 by the name Jean and age 30 to execute the query again.
Now we can see the idea.
13 name change to tome and age 33.
OK.
In this session, we were able to establish communication between the client and the server to rest
API, either able to connect to the database, fetch the information inside the data and add a new record
to eat and edit the record in the table.
We have reached the end of this session.
I hope you have take full advantage of this session onto the next session.
Goodbye.