- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are important HTTP headers to be frequently used in Python CGI Programming?
The line Content-type:text/html\r\n\r\n is part of HTTP header which is sent to the browser to understand the content. All the HTTP header will be in the following form −
HTTP Field Name − Field Content
Content-type − text/html\r\n\r\n
There are few other important HTTP headers, which we will use frequently in our CGI Programming.
|1||Content-type:||A MIME string defining the format of the file being returned. Example is Content-type:text/html|
|2||Expires: Date||The date the information becomes invalid. It is used by the browser to decide when a page needs to be refreshed. A valid date string is in the format 01 Jan 1998 12:00:00 GMT.|
|3||Location: URL||The URL that is returned instead of the URL requested. You can use this field to redirect a request to any file.|
|4||Last-modified: Date||The date of last modification of the resource.|
|5||Content-length: N||The length, in bytes, of the data being returned. The browser uses this value to report the estimated download time for a file.|
|6||Set-Cookie: String||Set the cookie passed through the string|
- What are good modules to be used for Python CGI Programming?
- How to read all HTTP headers in Python CGI script?
- What are important server response headers that are useful in web programming?
- What are some of the important Scientific Libraries used in Lua programming?
- What are environment variables available in Python CGI Programming?
- What are the modules required for CGI programming in Python?
- What are the headers used in a Data Link Layer?
- How to do CGI programming in Python?
- Program to implement Least Frequently Used Cache in Python
- How to setup cookies in Python CGI Programming?
- How to retrieve cookies in Python CGI Programming?
- How to configure Apache for Python CGI Programming?
- How to download image using Python CGI Programming?
- The best way to inspect HTTP response headers with Selenium
- How do cookies work in Python CGI Programming?