From d2ff0f40eb55ea572794daf286e74833ca773d59 Mon Sep 17 00:00:00 2001 From: Xu Pan Date: Sun, 26 Jun 2011 13:32:19 +0800 Subject: [PATCH] add doseq to urlencode in model._encode_params to enable list as dict value --- AUTHORS | 3 ++- requests/models.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8493a687ba..1f7c743fd9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,4 +26,5 @@ Patches and Suggestions - Richard Boulton - Miguel Olivares - Alberto Paro -- Jérémy Bethmont \ No newline at end of file +- Jérémy Bethmont +- 潘旭 (Xu Pan) diff --git a/requests/models.py b/requests/models.py index 8e6080194f..9b8f614f63 100644 --- a/requests/models.py +++ b/requests/models.py @@ -230,7 +230,7 @@ def _encode_params(data): for (k, v) in data.items(): result[k.encode('utf-8') if isinstance(k, unicode) else k] \ = v.encode('utf-8') if isinstance(v, unicode) else v - return result, urllib.urlencode(result) + return result, urllib.urlencode(result, doseq=True) else: return data, data