CGI Output
Header Syntax
- Header lines can be in any order
- The header block is terminated by a blank line
-
- Content-type: (MIME-type)
- text/html
- image/gif
- application/postscript
- Content-length: number of bytes
- Prevents server from encountering unexpected EOF
- Expires: date
- Gives date when data is no longer valid and should be reloaded by browser
- Pragma: no-cache
- Turns off caching of document (some browsers do not handle properly)
- Location: URL
- Server returns document specified by URL
- Status: status code number
- 200: OK
- 204: No Content (remains on current page)
- 301: Permanently Moved (new URL in Location header)
- 404: Not Found (client error)
- 500: Internal Server Error (server error)
-
Complete Headers
- Server: server-software
- Identifies the web server
- Any other headers that you did not specify