From 402f3b4993fe8d0626fcffcbfc30caf671b65df3 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Thu, 28 Aug 2014 19:27:45 -0700 Subject: [PATCH] Changes check on base and json. Fails on tests. --- requests/models.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/requests/models.py b/requests/models.py index 1b110b49..a96fc4e6 100644 --- a/requests/models.py +++ b/requests/models.py @@ -442,13 +442,12 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): if files: (body, content_type) = self._encode_files(files, data) else: - if data and not _json: + if data and _json is None: body = self._encode_params(data) - if not _json: - if isinstance(data, basestring) or hasattr(data, 'read'): - content_type = None - else: - content_type = 'application/x-www-form-urlencoded' + if isinstance(data, basestring) or hasattr(data, 'read'): + content_type = None + else: + content_type = 'application/x-www-form-urlencoded' self.prepare_content_length(body)