def headers(mime, length):
    """Returns a list of HTTP headers given the MIME type and the length of the
    content, in bytes (in integer or sting format)."""
    return [('Content-Type', mime),
            ('Content-Length', str(length))]