Try It (Web hosting uk) Out HTTP Client with gzip Compression
Try It Out HTTP Client with gzip Compression The following listing is a little HTTP client that s aware of gzip compression: import httplib import urllib2 import StringIO import gzip URI = http://thorne.id.au/feeds httplib.HTTPConnection.debuglevel = 1 request = urllib2.Request(URI) request.add_header( Accept-Encoding , gzip ) opener = urllib2.build_opener() message = opener.open(request) print message.headers if message.headers.get( Content-encoding ) == gzip : print ZIPPED! zipped = message.read() fileObject = StringIO.StringIO(zipped) data = gzip.GzipFile(fileobj=fileObject).read() else: data = message.read() print data 1. Enter the code into a text editor, and save the file as ZippyClient.py. 2. Open a command window in the same directory as you saved ZippyClient.py and type the following: python ZippyClient.py A header message should appear, closely followed by a lot of text content. 3. Modify the last line of the source code to read: # print data 4. Again, open a command window in the same directory as you saved ZippyClient.py and type: python ZippyClient.py Now that the printing of the data has been commented out, the header should be easier to read. It should look something like this: 227 Systematic Overview
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.