Questions tagged [httplib2]

A comprehensive HTTP client library

A comprehensive HTTP client library, httplib2 supports many features left out of other HTTP libraries.

217 questions
7
votes
1 answer

Is this a bug of httplib2

My python program use httplib2.Http to make http request. Once I need to generate a request, I create a httplib2.Http object, so that my program will frequently create/destroy httplib2.Http objects. I found my program was easy to crash due to reach…
TieDad
  • 9,143
  • 5
  • 32
  • 58
7
votes
2 answers

python, Json and string indices must be integers, not str

I am using Python, and I sent a request to a URL and received a reply using httplib2. The reply I got was in JSon, how do I access a specific parameter. What I have at the moment is: resp, content = parser.request(access_token_uri, method = 'POST',…
Meir
  • 1,943
  • 5
  • 22
  • 38
6
votes
2 answers

Is Twisted an httplib2/socket replacement?

Many python libraries, even recently written ones, use httplib2 or the socket interface to perform networking tasks. Those are obviously easier to code on than Twisted due to their blocking nature, but I think this is a drawback when integrating…
oparisy
  • 2,056
  • 2
  • 16
  • 17
6
votes
3 answers

How do I make calls to AWS with Python 3 and httplib2 on Windows 7?

I am using httplib2 to make calls to Amazon Web Services (AWS): http = httplib2.Http(cache='.cache') response, content = http.request('https://sdb.amazonaws.com/...') However it fails looking for CAs (I think): File…
Seth
  • 6,514
  • 5
  • 49
  • 58
6
votes
2 answers

Google API + proxy + httplib2

I'm currently running a script to pull data from Google Analytics with googleapiclient Python package (that is based on httplib2 client object) --> My script works perfectly without any proxy. But I have to put it behind my corporate proxy, so I…
6
votes
4 answers

httplib2, how to set more than one cookie?

As you are probably aware, more often than not, an HTTP server will send more than just a session_id cookie; however, httplib2 handles cookies with a dictionary, like this: response, content = http.request(url, 'GET', headers=headers) headers =…
user168833
  • 167
  • 2
  • 8
6
votes
2 answers

Best practise when using httplib2.Http() object

I'm writing a pythonic web API wrapper with a class like this import httplib2 import urllib class apiWrapper: def __init__(self): self.http = httplib2.Http() def _http(self, url, method, dict): ''' Im using this…
tomaz
  • 141
  • 2
  • 6
5
votes
2 answers

How can I examine the network communications of the Python HTTP Client?

I'm trying to isolate a bug that exists either in Python's httplib2 HTTP client or an API. (First guess is the API.) While using httplib2 to POST data to a RESTful API, I'm getting a 401 response status (no authorization) and saving data to the…
chernevik
  • 3,922
  • 9
  • 41
  • 55
5
votes
3 answers

Can I do preemptive authentication with httplib2?

I need to perform preemptive basic authentication against an HTTP server, i.e., authenticate right away without waiting on a 401 response. Can this be done with httplib2? Edit: I solved it by adding an Authorization header to the request, as…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
5
votes
2 answers

Python httplib2 Handling Exceptions

I have this very simple code to check if a site is up or down. import httplib2 h = httplib2.Http() response, content = h.request("http://www.folksdhhkjd.com") if response.status == 200: print "Site is Up" else: print "Site is down" When I…
Bhavani Kannan
  • 1,269
  • 10
  • 29
  • 46
5
votes
3 answers

How do I properly install httplib2 on Google App Engine?

I copied my httplib2 directory into my GAE project, and now I'm getting the following error: line 64, in _ssl_wrap_socket = ssl.wrap_socket Is this an issue with Google App Engine, or did I somehow install my httplib2 incorrectly? Full…
bravely
  • 185
  • 3
  • 12
5
votes
0 answers

How to handle ChunkedEncodingError for IncompleteRead while stream data from remote url on server

I am trying to stream data from a remote host on my server using python requests library but getting ChunkedEncodingError with ImcompleteRead in deficiency of requested bytes, I made a request with chunk of 4096bytes but server sent me partial at…
Shashank
  • 462
  • 1
  • 8
  • 26
5
votes
3 answers

Python create cookies and then load a page with the cookies

I would like to access a web page from a python program. I have to set up cookies to load the page. I used the httplib2 library, but I didn't find how add my own cookie resp_headers, content = h.request("http://www.theURL.com", "GET") How can I…
Mac Fly
  • 359
  • 1
  • 7
  • 22
5
votes
1 answer

HEAD and GET http request return different status code for the same URL

I'm trying to check if some URLs that are stored in my DB are still valid links or not. To achieve this, I am using httplib2 to request the HEAD status in order to avoid downloading the entire content of the page. And I was quite happy with the…
Valkea
  • 1,216
  • 1
  • 12
  • 26
5
votes
2 answers

httplib2.SSLHandshakeError while Installing Google Cloud SDK

While installing the Google Cloud SDK - Python, a httplib2.SSLHandshakeError keeps occuring. I have configured the unfilled_client_secrets.json (shown below the return). And this has not solved the HandshakeError. Similar questions have been asked…
1
2
3
14 15