Write a CGI program to show the header part?
Write a CGI program to show the header part?
- CGI program can either send the newly created data to the client directly or it can send the data through the server to the client.
- The data sent depend on the output, if the output consists of HTTP header then the data is sent directly to the client otherwise it goes through the server.
- Server plays a part in this by adding the complete header information and uses HTTP protocol to transfer the data to the client directly.
- The header that is being passed looks like this:
HTTP/1.0 200 OK
Date: Thursday, 22-February-96 08:28:00 GMT
Server: NCSA/1.4.2
MIME-version: 1.0
Content-type: text/html
Content-length: 2000
<HTML>
<HEAD><TITLE>Welcome to WWW Server!</TITLE></HEAD>
<BODY>
<H1>HELLO!</H1>
</BODY>
</HTML>
- This way the header contains the information of communication protocol, date and time of response and the server name with its version.