mardi 31 mai 2016

Understanding web server response

I am learning how to write a simple webserver. I got two questions:

1.I created a file called HelloWorld.html and place it in the same dir as my webserver.

<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>

Then i type the following url in chrome:

http://localhost:8888/HelloWorld.html

My webserver listening 8888 will open HelloWorld.html and send the content to the connection chrome uses directly. This means that I did not sent any http header information to chrome. But I can still see chrome renders the "Hello world" in the page properly. Why?

2.I want to improve my webserver and send a proper http response header. But I dont know how to get a sample response. What tool should I use to get a sample response from an internet page?




Aucun commentaire:

Enregistrer un commentaire