From 302c4d9c4131dd075382152c7d33cfb6275156a4 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 22 Oct 2011 21:01:45 -0400 Subject: [PATCH] Don't alter behavior for safe methods anymore. --- requests/models.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/requests/models.py b/requests/models.py index b2142ea..65c047c 100644 --- a/requests/models.py +++ b/requests/models.py @@ -332,22 +332,22 @@ class Request(object): )) + # Build the URL url = self._build_url() - if self.method in ('GET', 'HEAD', 'DELETE'): - req = _Request(url, method=self.method) - else: - if self.files: - register_openers() - if self.data: - self.files.update(self.data) + if self.files: + register_openers() - datagen, headers = multipart_encode(self.files) - req = _Request(url, data=datagen, headers=headers, method=self.method) + if self.data: + self.files.update(self.data) + + datagen, headers = multipart_encode(self.files) + req = _Request(url, data=datagen, headers=headers, method=self.method) + + else: + req = _Request(url, data=self._enc_data, method=self.method) - else: - req = _Request(url, data=self._enc_data, method=self.method) if self.headers: for k,v in self.headers.iteritems(): -- 2.7.4