Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
Parsing MIME-encoded data in an HTTP request
 

Index | Next | Previous | View Flat


rNOSPAMon at flownet

Jul 3, 2008, 1:59 PM


Views: 155
Permalink
Parsing MIME-encoded data in an HTTP request

I'm writing a little HTTP server and need to parse request content that
is mime-encoded. All the MIME routines in the Python standard library
seem to have been subsumed into the email package, which makes this
operation a little awkward. It seems I have to do the following:

1. Extract the content-length header from the HTTP request and use that
to read the payload.

2. Stick some artificial-looking headers onto the beginning of this
payload to make it look like an email message (including the
content-type and content-transfer-encoding headers)

3. Parse the resulting string into a email message

That works, but it feels way too hackish for my tastes. Surely there
must be a better/more standard way of doing this?

Thanks,
rg
--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
Parsing MIME-encoded data in an HTTP request rNOSPAMon at flownet Jul 3, 2008, 1:59 PM
    Re: Parsing MIME-encoded data in an HTTP request s0suk3 at gmail Jul 3, 2008, 8:50 PM
    Re: Parsing MIME-encoded data in an HTTP request rNOSPAMon at flownet Jul 4, 2008, 12:17 AM
    Re: Parsing MIME-encoded data in an HTTP request michael at stroeder Jul 4, 2008, 12:49 AM
        Re: Parsing MIME-encoded data in an HTTP request rNOSPAMon at flownet Jul 4, 2008, 3:30 PM
    Re: Parsing MIME-encoded data in an HTTP request rNOSPAMon at flownet Jul 4, 2008, 3:37 PM
    Re: Parsing MIME-encoded data in an HTTP request michael at stroeder Jul 5, 2008, 2:11 AM
        Re: Parsing MIME-encoded data in an HTTP request rNOSPAMon at flownet Jul 6, 2008, 12:47 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.