From: Carol Willing Date: Fri, 29 Aug 2014 02:27:45 +0000 (-0700) Subject: Changes check on base and json. Fails on tests. X-Git-Tag: v2.4.2~4^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=402f3b4993fe8d0626fcffcbfc30caf671b65df3;p=services%2Fpython-requests.git Changes check on base and json. Fails on tests. --- diff --git a/requests/models.py b/requests/models.py index 1b110b4..a96fc4e 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)