diff --git a/http-web-services.html b/http-web-services.html index b72a875..cc952b0 100755 --- a/http-web-services.html +++ b/http-web-services.html @@ -305,7 +305,66 @@ Content-Type: application/xml

Introducing httplib2

-

FIXME paragraph/example on downloading and installing it. +

Before you can use httplib2, you’ll need to install it. Visit code.google.com/p/httplib2/ and download the latest version. httplib2 is available for Python 2.x and Python 3.x; make sure you get the Python 3 version, named something like httplib2-python3-0.5.0.zip. + +

Unzip the archive, open a terminal window, and go to the newly created httplib2 directory. On Windows, open the Start menu, select Run..., type cmd.exe and press ENTER. + +

+c:\Users\pilgrim\Downloads> dir
+ Volume in drive C has no label.
+ Volume Serial Number is DED5-B4F8
+
+ Directory of c:\Users\pilgrim\Downloads
+
+07/28/2009  12:36 PM    <DIR>          .
+07/28/2009  12:36 PM    <DIR>          ..
+07/28/2009  12:36 PM    <DIR>          httplib2-python3-0.5.0
+07/28/2009  12:33 PM            18,997 httplib2-python3-0.5.0.zip
+               1 File(s)         18,997 bytes
+               3 Dir(s)  61,496,684,544 bytes free
+
+c:\Users\pilgrim\Downloads> cd httplib2-python3-0.5.0
+c:\Users\pilgrim\Downloads\httplib2-python3-0.5.0> c:\python31\python.exe setup.py install
+running install
+running build
+running build_py
+running install_lib
+creating c:\python31\Lib\site-packages\httplib2
+copying build\lib\httplib2\iri2uri.py -> c:\python31\Lib\site-packages\httplib2
+copying build\lib\httplib2\__init__.py -> c:\python31\Lib\site-packages\httplib2
+byte-compiling c:\python31\Lib\site-packages\httplib2\iri2uri.py to iri2uri.pyc
+byte-compiling c:\python31\Lib\site-packages\httplib2\__init__.py to __init__.pyc
+running install_egg_info
+Writing c:\python31\Lib\site-packages\httplib2-python3_0.5.0-py3.1.egg-info
+ +

On Mac OS X, run the Terminal.app application in your /Applications/Utilities/ folder. On Linux, run the Terminal application, which is usually in your Applications menu under Accessories or System. + +

+you@localhost:~/Desktop$ unzip httplib2-python3-0.5.0.zip
+Archive:  httplib2-python3-0.5.0.zip
+  inflating: httplib2-python3-0.5.0/README
+  inflating: httplib2-python3-0.5.0/setup.py
+  inflating: httplib2-python3-0.5.0/PKG-INFO
+  inflating: httplib2-python3-0.5.0/httplib2/__init__.py
+  inflating: httplib2-python3-0.5.0/httplib2/iri2uri.py
+you@localhost:~/Desktop$ cd httplib2-python3-0.5.0/
+you@localhost:~/Desktop/httplib2-python3-0.5.0$ sudo python3 setup.py install
+running install
+running build
+running build_py
+creating build
+creating build/lib.linux-x86_64-3.0
+creating build/lib.linux-x86_64-3.0/httplib2
+copying httplib2/iri2uri.py -> build/lib.linux-x86_64-3.0/httplib2
+copying httplib2/__init__.py -> build/lib.linux-x86_64-3.0/httplib2
+running install_lib
+creating /usr/local/lib/python3.0/dist-packages/httplib2
+copying build/lib.linux-x86_64-3.0/httplib2/iri2uri.py -> /usr/local/lib/python3.0/dist-packages/httplib2
+copying build/lib.linux-x86_64-3.0/httplib2/__init__.py -> /usr/local/lib/python3.0/dist-packages/httplib2
+byte-compiling /usr/local/lib/python3.0/dist-packages/httplib2/iri2uri.py to iri2uri.pyc
+byte-compiling /usr/local/lib/python3.0/dist-packages/httplib2/__init__.py to __init__.pyc
+running install_egg_info
+Writing /usr/local/lib/python3.0/dist-packages/httplib2-python3_0.5.0.egg-info

To use httplib2, create an instance of the httplib2.Http class.