I forgot to make a post about this a couple weeks ago. In CSE-297 Web Application, for our first Homework assignment we were asked to build a miniature HTTP Web Server. HTTP stands for Hypertext Transfer Protocol. It is how data is communicated over the world wide web. Before we begin learning languages to build actual web applications, it was important for us to learn and understand HTTP since it dictates how our web applications will interact with web servers. We just learned some basic Networking Principles and Protocols.
So getting back to the Homework assignment, we needed to make a scaled-down HTTP web server and implement two things:
- A Content-Type Header
- Last-Modified Date
The Content-Type Header is suppose to return/display the type of the resource that is being requested. For example, if the resource being requested is flower.png, then it should have the header:
And the Last-Modified Header will show the date of the last time a file was modified.
This homework assignment was programmed in Java, and in only about 180 lines of code it was possible to build an HTTP Web Server. Our professor told us we will be able to do the same thing in 5 lines of code later in the semester.
Below is a screenshot of my project running using a test webpage our professor provided to us. There is an excel spreadsheet on the webpage and once clicked, you can see in the right window the HTTP headers I described above.