diff options
author | Carol Willing <carolcode@willingconsulting.com> | 2014-08-28 19:27:45 -0700 |
---|---|---|
committer | Carol Willing <carolcode@willingconsulting.com> | 2014-08-28 19:27:45 -0700 |
commit | 402f3b4993fe8d0626fcffcbfc30caf671b65df3 (patch) | |
tree | 300d7f24d6cb7d6a49dbbe97ff8e6d8f802a1c77 | |
parent | b34a496649667b9324caa634cb17e726e0cce1a5 (diff) | |
download | python-requests-402f3b4993fe8d0626fcffcbfc30caf671b65df3.tar.gz |
Changes check on base and json. Fails on tests.
-rw-r--r-- | requests/models.py | 11 |
1 files 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) |