pyweblib.httphelper (version 0.0.4) | index /usr/lib/python2.3/site-packages/pyweblib/httphelper.py

`httphelper.py - basic HTTP-related functions
(c) by Michael Stroeder <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)
$Id: pyweblib.httphelper.html,v 1.12 2004/08/24 10:26:30 michael Exp $`

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...')
  `Output HTML text with redirecting <head> section.`

Data
`` |  | HTTP_LINESEP = '\r\n' __version__ = '0.0.4'