pyweblib.httphelper
index
/home/michael/Proj/python/PyWebLib/pyweblib/httphelper.py

httphelper.py - basic HTTP-related functions
(C) 1998-2015 by Michael Ströder <michael@stroeder.com>
 
This module is distributed under the terms of the
GPL (GNU GENERAL PUBLIC LICENSE) Version 2
(see http://www.gnu.org/copyleft/gpl.html)

 
Modules
       
sys
time

 
Functions
       
DateTimeRFC1123(secs=0)
Return seconds as RFC1123 date/time format preferred
for HTTP 1.1 (see RFC2616)
SendHeader(outf=<open file '<stdout>', mode 'w'>, contenttype='text/html', charset='ISO-8859-1', contentlength=None, expires_offset=0, current_datetime=None, additional_header=None)
Generate HTTP header
 
outf
    File object used for sending to client.
contenttype
    MIME type of object in HTTP body. Default is 'text/html'.
charset
    Character set used. Default is 'ISO-8859-1'.
contentlength
    Content-Length if known and gzip-encoding is not used.
    Default is None indicating unknown length.
expires_offset=0,
    Expiry time from current time in seconds. Default is 0.
current_datetime
    Last modification time in seconds.
    If zero (default) 'Last-modified' header will be omitted.
additional_header
    Dictionary containing arbitrary additional HTTP header fields
    as key/value-pairs.
SimpleMsg(outf, msg)
Output HTML text.
URLRedirect(outf, url, refreshtime=0, msg='Redirecting...', additional_header=None)
Output HTML text with redirecting <head> section.

 
Data
        HTTP_LINESEP = '\r\n'
__info__ = '$Id: pyweblib.httphelper.html,v 1.13 2015/01/10 14:40:54 michael Exp $'
__revision__ = '1.15'