So guys, let us discuss the observation regarding Http web server design and implementation that we
have discussed.
So we implemented the Http web server, which could understand only the client request, right?
Because our Http web server expects the Http request from the client and we have implemented the Http
web server which could understand only the get and post request from the client.
Right.
As Http web server runs as an application on top of the TCP transport layer protocol.
So remember, we have implemented our Http web server on top of the transport layer protocol, which
is TCP.
Thus Http is an application layer protocol.
Also, one thing to note here is that instead of TCP protocol, you can also have used UDP protocol.
Nobody is stopping you from using UDP protocol also, so you can very well implement the Http protocol
on the top of UDP protocol also.
So basically any application which can run on top of the TCP protocol, that application can also be
run on top of UDP protocol.
Right.
So in this case, our application is nothing, but it is our Http web server.
So Http web server parse the client's URL and accordingly take the action to be performed.
So we have already seen in our code block that our Http web server parse the request line and find out
whether the request is a get request or post request, and after that it parses the URL part of the
request line.
And from this line it's find out that what actually needs to be done.
Azure Web server returns the HTML code because the HTML clients, which are nothing but browsers, understand
the HTML code and render it.
As Http protocol.
Message types are simple plain text strings.
Hence we need to struggle through string manipulation on the server side.
So we have already seen that in the code walkthrough you have seen STR talk function strcpy function
and str Len function or STR function.
So we are forced to use these many string manipulative functions on the server side because Http protocol
by itself is a protocol whose messages are nothing but plain text strings and we need to manipulate
those plain text strings on the server.
And that is the reason that Http server have to do too much of string manipulation.
So this is how internet browsing works.
Any click sends get request to the Http server as Http server prepares the HTML code of the web page
pointed to by the link and sends back to the client and the client that is the browser eventually loads
the page and show it to you.
So let us discuss the assignment for this module.
I have shown you how to implement the Http get request.
So your assignment is implement the Http post request and add the details of one of the student to server
local database.
So server local database is just an array and using http post request, send the details of the student
from the browser and your server.
After receiving the post request from the client must add the details of the student into its local
database.
So server can return success or fail to the client as a result.
So assignment location is here.
I have already shared this path to you and inside this directory you can go and you can go inside that
path.
And this is the file that you need to.
Modify.
So inside this file you can see that there is an empty function process post request.
So you have to implement the functionality of this function.
Right.
So this functionality should be so the functionality of this function should be that it should pass
the URL and using this URL, it should extract out the information that is being sent by the browser
to the server and and that student information should be stored in the server's local database of students.
So this is actually post request.
That is the server that is the client is sending the data to the server which eventually needs to be
stored on the server side.
So this is your assignment for this module that implement the post request.
And if you want to do some more bonus thing, then after post request you can go on and implement the
delete request that is http delete request.
So delete request must delete the student information from the local database of the server.
So to implement the post or delete request, you should browse the internet and see what is the message
format of the post request that the server receives from the client.
And accordingly do the string manipulation or string handling in this function and pass the URL and
extract out the information and process that student information accordingly.
So this is the assignment for you?
For this module.