httplib2

raw JSON →
0.31.2 verified Tue May 12 auth: no python install: verified quickstart: verified

A comprehensive HTTP client library supporting HTTP and HTTPS, authentication, caching, and more. Current version: 0.31.2, released on January 23, 2026. Maintained with regular updates.

pip install httplib2
error ModuleNotFoundError: No module named 'httplib2'
cause The `httplib2` library is not installed in the Python environment being used, or the Python interpreter cannot find it due to an incorrect PATH or virtual environment issue.
fix
Ensure httplib2 is installed for the correct Python interpreter by running pip install httplib2 or pip3 install httplib2.
error httplib2.SSLHandshakeError: ('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')
cause This error occurs when `httplib2` cannot verify the SSL/TLS certificate of the server, often due to outdated CA certificates, a self-signed certificate, or an incorrect `ca_certs` path being provided.
fix
To resolve this, you can either update your system's CA certificates, specify an up-to-date cacert.pem file using the ca_certs parameter, or, for testing purposes, temporarily disable SSL certificate validation (use with caution): h = httplib2.Http(disable_ssl_certificate_validation=True).
error AttributeError: module 'httplib2' has no attribute 'SSLHandshakeError'
cause This error indicates that the specific `SSLHandshakeError` exception class is not available in the `httplib2` version being used, often appearing when migrating older code to a newer `httplib2` version or Python 3 where exception names or structures may have changed.
fix
Update httplib2 to a version that includes SSLHandshakeError if you intend to catch it explicitly, or refactor your error handling to catch more general httplib2.Error or ssl.SSLError exceptions.
error ERROR: httplib2 transport does not support per-request timeout. Set the timeout when constructing the httplib2.Http instance.
cause This message indicates that a timeout was attempted to be set on a per-request basis, but `httplib2` requires the timeout to be configured when the `httplib2.Http` instance is initialized.
fix
Set the timeout parameter during the initialization of the Http object, for example: h = httplib2.Http(timeout=30).
breaking Ensure 'simplejson' is installed for optimal performance; otherwise, 'json' module will be used.
fix Install 'simplejson' using 'pip install simplejson'.
gotcha Be cautious with SSL/TLS configurations; incorrect settings can lead to security vulnerabilities.
fix Review SSL/TLS settings and ensure they comply with security best practices.
gotcha Running pip as the 'root' user can lead to broken permissions and conflicts with the system package manager; it is recommended to use a virtual environment.
fix Use a virtual environment for installing Python packages to avoid permission issues and conflicts (e.g., 'python -m venv .venv' then 'source .venv/bin/activate').
breaking Running pip as the 'root' user can result in broken permissions and conflicting behavior with the system package manager, potentially rendering your system unusable.
fix It is recommended to use a virtual environment instead of running pip as 'root'. If running as 'root' is necessary, use the '--root-user-action' option to suppress this warning, understanding the implications.
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.40s 19.0M
3.10 slim (glibc) - - 0.25s 20M
3.11 alpine (musl) - - 0.46s 21.1M
3.11 slim (glibc) - - 0.37s 22M
3.12 alpine (musl) - - 0.42s 12.9M
3.12 slim (glibc) - - 0.40s 13M
3.13 alpine (musl) - - 0.39s 12.5M
3.13 slim (glibc) - - 0.39s 13M
3.9 alpine (musl) - - 0.29s 18.5M
3.9 slim (glibc) - - 0.23s 19M

Basic usage example demonstrating how to make a GET request using httplib2.

import os
from httplib2 import Http

# Initialize Http object
http = Http()

# Make a GET request
url = 'http://example.com'
response, content = http.request(url, 'GET')

# Print response status
print(f'Response status: {response.status}')