cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,
StringIO, is_py2, chardet, json)
+from __builtin__ import str as builtin_str
+
REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)
CONTENT_CHUNK_SIZE = 10 * 1024
if self.data:
body = self._encode_params(self.data)
- if isinstance(self.data, str) or hasattr(self.data, 'read'):
+ if isinstance(self.data, str) or isinstance(self.data, builtin_str) or hasattr(self.data, 'read'):
content_type = None
else:
content_type = 'application/x-www-form-urlencoded'
self.assertEqual(t.get('files'), files)
def test_str_data_content_type(self):
- data = "test string data"
+ data = 'test string data'
r = post(httpbin('post'), data=data)
t = json.loads(r.text)
- self.assertEqual(t.get('headers').get('Content-Type'), 'text/plain')
+ self.assertEqual(t.get('headers').get('Content-Type'), '')
if __name__ == '__main__':