From 4fe22743e6c59cf5314a4d1161432ef3bb3eb159 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 15 Jul 2009 15:53:00 -0400 Subject: [PATCH] fixed typo, clarified how to check for compressed content --- http-web-services.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-web-services.html b/http-web-services.html index da62a34..da99257 100755 --- a/http-web-services.html +++ b/http-web-services.html @@ -477,7 +477,7 @@ reply: 'HTTP/1.1 200 OK' 'etag': '"7f806d-1a01-9fb97900"', 'last-modified': 'Tue, 02 Jun 2009 02:51:48 GMT', 'server': 'Apache', - 'status': '304', + 'status': '200', 'vary': 'Accept-Encoding,User-Agent'} >>> len(content) 6657 @@ -544,7 +544,7 @@ reply: 'HTTP/1.1 200 OK' 'vary': 'Accept-Encoding,User-Agent'}
  1. Every time httplib2 sends a request, it includes an Accept-Encoding header to tell the server that it can handle either deflate or gzip compression. -
  2. In this case, the server has responded with a gzip-compressed payload. By the time the request() method returns, httplib2 has already decompressed the body of the response and placed it in the content variable. If you’re curious about whether or not the response was compressed, you can check the response dictionary; otherwise, don’t worry about it. +
  3. In this case, the server has responded with a gzip-compressed payload. By the time the request() method returns, httplib2 has already decompressed the body of the response and placed it in the content variable. If you’re curious about whether or not the response was compressed, you can check response['-content-encoding']; otherwise, don’t worry about it.

How httplib2 Handles Redirects