From 2ec135137dccf20bd9d512638478eed6d619c1bf Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Thu, 23 Aug 2012 23:25:21 +0200 Subject: [PATCH] Rest protocols should now accept multipart/form-data posts (see issue #4) --- wsme/protocols/rest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wsme/protocols/rest.py b/wsme/protocols/rest.py index 5e84df9..3fcd933 100644 --- a/wsme/protocols/rest.py +++ b/wsme/protocols/rest.py @@ -47,8 +47,10 @@ class RestProtocol(Protocol): funcdef = context.funcdef if 'Content-Type' in request.headers \ - and "application/x-www-form-urlencoded" in \ - request.headers['Content-Type']: + and ("application/x-www-form-urlencoded" + in request.headers['Content-Type'] + or "multipart/form-data" + in request.headers['Content-Type']): # The params were read from the body, ignoring the body then pass elif len(request.params) and request.content_length: