Merge pull request #1116 from Lukasa/master

Correct type of Content-Length headers.
This commit is contained in:
Kenneth Reitz
2013-01-22 18:51:17 -08:00
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -346,7 +346,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
])
try:
length = super_len(data)
length = str(super_len(data))
except (TypeError, AttributeError):
length = False
+6 -2
View File
@@ -9,6 +9,12 @@ import unittest
import requests
from requests.auth import HTTPDigestAuth
from requests.compat import str
try:
import StringIO
except ImportError:
import io as StringIO
HTTPBIN = os.environ.get('HTTPBIN_URL', 'http://httpbin.org/')
@@ -131,8 +137,6 @@ class RequestsTestCase(unittest.TestCase):
self.assertEqual(r.status_code, 200)
def test_BASICAUTH_TUPLE_HTTP_200_OK_GET(self):
auth = ('user', 'pass')
url = httpbin('basic-auth', 'user', 'pass')