Adding GZip support to urllib3 (#704)

* Adding GZip support to urllib3

* Adding compression documentation and example

* Convert to lowercase for consistency

* Moving header manipulation to __init__()

* Validating headers for compression

* Moving body compression out of the headers block

* Don't compress if there is no body

* Infer true
This commit is contained in:
robgil
2018-03-13 10:34:25 -06:00
committed by Nick Lang
parent c3544296ef
commit 64c125d34c
3 changed files with 26 additions and 1 deletions
+5
View File
@@ -32,6 +32,11 @@ class TestUrllib3Connection(TestCase):
)
self.assertTrue(con.use_ssl)
def test_http_compression(self):
con = Urllib3HttpConnection(http_compress=True)
self.assertTrue(con.http_compress)
self.assertEquals(con.headers['content-encoding'], 'gzip')
def test_timeout_set(self):
con = Urllib3HttpConnection(timeout=42)
self.assertEquals(42, con.timeout)