classification
Title: multipart/form-data encoding
Type: feature request Stage: test needed
Components: Library (Lib) Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Support iterable bodies in httplib
View: 3243
Superseder:
Assigned To: barry Nosy List: ajaksu2, barry, catlee, fsteinel, gotgenes, orsenthil (6)
Priority: normal Keywords: easy

Created on 2008-06-30 18:04 by catlee, last changed 2009-05-04 15:45 by barry.

Messages (4)
msg69015 - (view) Author: Chris AtLee (catlee) Date: 2008-06-30 18:04
The standard library should provide a way to encode data using the
standard multipart/form-data encoding.

This encoding is required to support file uploads via HTTP POST (or PUT)
requests.

Ideally file data could be streamed to the remote server if httplib
supported iterable request bodies (see issue #3243).

Mailing list thread:
http://mail.python.org/pipermail/python-dev/2008-June/080783.html
msg76356 - (view) Author: Florian Steinel (fsteinel) Date: 2008-11-24 19:38
see http://code.activestate.com/recipes/146306/ for a user contributed
implementation.
msg76357 - (view) Author: Chris AtLee (catlee) Date: 2008-11-24 19:54
I also wrote some software to handle this:
http://atlee.ca/software/poster/poster.encode.html

The reason I wrote this is to avoid having the load the entire file into
memory before posting the request.

This, along with Issue #3243, would allow streaming uploads of files via
HTTP POST.
msg81498 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-02-09 21:47
So, what is the best way to go about this (beyond docs and tests)? Beat
the linked recipe into a patch, adapt Chris' implementation?
History
Date User Action Args
2009-05-04 15:45:25barrysetassignee: barry

nosy: + barry
2009-04-22 18:48:42ajaksu2setpriority: normal
2009-02-12 17:47:25ajaksu2setkeywords: + easy
nosy: + orsenthil
dependencies: + Support iterable bodies in httplib
stage: test needed
2009-02-09 21:47:09ajaksu2setnosy: + ajaksu2
messages: + msg81498
2009-01-07 18:29:50gotgenessetnosy: + gotgenes
2008-11-24 19:54:47catleesetmessages: + msg76357
2008-11-24 19:38:54fsteinelsetnosy: + fsteinel
messages: + msg76356
2008-06-30 18:04:19catleecreate