Should Django handle uploaded files in PUT as well as POST?

2010-01-15 Thread Malcolm Box
Hi, I'm working on a REST-full API that allows an uploaded file to be PUT to a URL. I also need to support the X-Http-Method-Override header to turn a POST request into a PUT for clients (Flash, mobile etc) that can't do PUT. At the moment I've got the API working with POST requests, and am now

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-15 Thread Russell Keith-Magee
On Sat, Jan 16, 2010 at 6:32 AM, Malcolm Box wrote: > Hi, > > I'm working on a REST-full API that allows an uploaded file to be PUT to a > URL.  I also need to support the X-Http-Method-Override header to turn a > POST request into a PUT for clients (Flash, mobile etc) that can't do PUT. > > At th

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-17 Thread Malcolm Box
On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee wrote: > On Sat, Jan 16, 2010 at 6:32 AM, Malcolm Box > wrote: > > > It seems to me that Django should process POST and PUT requests the same > - > > i.e. the request.FILES attribute should be initialised for either if a > > multipart content

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-17 Thread Russell Keith-Magee
On Mon, Jan 18, 2010 at 8:14 AM, Malcolm Box wrote: > On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee > wrote: >> >> On Sat, Jan 16, 2010 at 6:32 AM, Malcolm Box >> wrote: >> >> > It seems to me that Django should process POST and PUT requests the same >> > - >> > i.e. the request.FILES at

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-18 Thread Malcolm Box
On Mon, Jan 18, 2010 at 2:04 AM, Russell Keith-Magee wrote: > On Mon, Jan 18, 2010 at 8:14 AM, Malcolm Box > wrote: > > On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee> Which raises the > question of what the correct behaviour should be, so the > > bug can report that it's not happening and

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-18 Thread Masklinn
On 18 Jan 2010, at 03:04 , Russell Keith-Magee wrote: > > On Mon, Jan 18, 2010 at 8:14 AM, Malcolm Box wrote: >> On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee >> wrote: >>> >>> On Sat, Jan 16, 2010 at 6:32 AM, Malcolm Box >>> wrote: >>> It seems to me that Django should process PO

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-18 Thread Malcolm Box
On Mon, Jan 18, 2010 at 9:23 AM, Masklinn wrote: > On 18 Jan 2010, at 03:04 , Russell Keith-Magee wrote: > > > > On Mon, Jan 18, 2010 at 8:14 AM, Malcolm Box > wrote: > >> On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee > >> Which raises the question of what the correct behaviour should be,

Re: Should Django handle uploaded files in PUT as well as POST?

2010-01-18 Thread Russell Keith-Magee
On Mon, Jan 18, 2010 at 5:23 PM, Masklinn wrote: > On 18 Jan 2010, at 03:04 , Russell Keith-Magee wrote: >> >> On Mon, Jan 18, 2010 at 8:14 AM, Malcolm Box wrote: >>> On Sat, Jan 16, 2010 at 4:58 AM, Russell Keith-Magee >>> wrote: On Sat, Jan 16, 2010 at 6:32 AM, Malcolm Box wrot

Re: Should Django handle uploaded files in PUT as well as POST?

2010-04-23 Thread Chester (Carlos Duarte do Nascimento)
This is a somewhat old topic, but a workaround for those (such as myself) who need to process parameters from the request body on non-POST methods (such as PUT) is to write: body_params = QueryDict(request.raw_post_data, encoding=request.encoding) and use this dictionary (body_params) in the same