From e8f3fc33bb66fccde7d7316ab0afef7d1d601183 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Jun 2012 21:54:45 -0400 Subject: [PATCH] test that empty body text responses work --- tests/test_requests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_requests.py b/tests/test_requests.py index de34cfa..3adae04 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -913,5 +913,12 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase): r2 = requests.get(httpbin('get'), config=dict(keep_alive=False)) self.assertEqual(r2.headers['Connection'].lower(), 'close') + def test_head_content(self): + """Test that empty bodies are properly supported.""" + + r = requests.head(httpbin('headers')) + r.content + r.text + if __name__ == '__main__': unittest.main() -- 2.34.1