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
65
votes
2 answers

How to specify python requests http put body?

I'm trying to rewrite some old python code with requests module. The purpose is to upload an attachment. The mail server requires the following specification…
omer bach
  • 2,345
  • 5
  • 30
  • 46
49
votes
6 answers

"ImportError: No module named httplib2" even after installation

I'm having a hard time understanding why I get ImportError: No module named httplib2 after making sure httplib2 is installed. See below: $ which -a python /usr/bin/python /usr/local/bin/python $ pip -V pip 1.4.1 from…
Ben
  • 4,980
  • 3
  • 43
  • 84
40
votes
4 answers

104, 'Connection reset by peer' socket error, or When does closing a socket result in a RST rather than FIN?

We're developing a Python web service and a client web site in parallel. When we make an HTTP request from the client to the service, one call consistently raises a socket.error in socket.py, in read: (104, 'Connection reset by peer') When I listen…
jwhitlock
  • 4,572
  • 4
  • 39
  • 49
34
votes
3 answers

How do I get the IP address from a http request using the requests library?

I am making HTTP requests using the requests library in python, but I need the IP address from the server that responded to the HTTP request and I'm trying to avoid making two calls (and possibly having a different IP address from the one that…
gawry
  • 762
  • 1
  • 9
  • 18
18
votes
6 answers

Python: Httplib2 Module Not Found

I tried to import the module but i am getting the error shown below:- sh-3.2# python -V Python 2.6.4 sh-3.2# python -c "import httplib2" Traceback (most recent call last): File "", line 1, in ImportError: No module named…
asdasdsad
  • 181
  • 1
  • 1
  • 3
15
votes
3 answers

Frappe installation error "AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'"

When I install frappe ( version-13 ) on linux when I run bench init it gives an error ERROR: httplib2 0.20.1 has requirement pyparsing<3,>=2.4.2, but you'll have pyparsing 3.0.0 which is incompatible. though the installation goes through. After…
Hari
  • 163
  • 1
  • 1
  • 5
15
votes
5 answers

how to follow meta refreshes in Python

Python's urllib2 follows 3xx redirects to get the final content. Is there a way to make urllib2 (or some other library such as httplib2) also follow meta refreshes? Or do I need to parse the HTML manually for the refresh meta tags?
hoju
  • 28,392
  • 37
  • 134
  • 178
11
votes
4 answers

Using Httplib2 on Python Appengine

Why am I getting this error when running my application which is trying to OAuth with Foursquare? import httplib2 ImportError: No module named httplib2 I have installed httplib2 by downloading it and $ python setup.py install on the command line…
keith
  • 195
  • 1
  • 7
10
votes
4 answers

Httplib2 ssl error

Today I faced one interesting issue. I'm using the foursquare recommended python library httplib2 raise SSLHandshakeError(SSLError(1, '_ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed'),) while trying…
user1876339
  • 319
  • 1
  • 2
  • 7
9
votes
1 answer

ImportError: No module named httplib2

I have a Python 2.7 GAE app that already has a lot of functionality. Now I want to integrate with a Google API. Within my IDE (PyCharm) running on Mac OSX, I added the following lines to my app's main program: import httplib2 pass When I…
Lindsay
  • 1,461
  • 16
  • 26
8
votes
4 answers

Why does this url raise BadStatusLine with httplib2 and urllib2?

Using httplib2 and urllib2, I'm trying to fetch pages from this url, but all of them didn't work out and ended up with this exception. content = conn.request(uri="http://www.zdnet.co.kr/news/news_print.asp?artice_id=20110727092902") Traceback (most…
goodhyun
  • 4,814
  • 3
  • 33
  • 25
8
votes
2 answers

How to do mutual certificate authentication with httplib2

I'm using httplib2 to make a request from my server to another web service. We want to use mutual certificate authentication. I see how to use a certificate for the outgoing connection (h.set_certificate), but how do I check the certificate used…
Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
8
votes
2 answers

Intermittent "sslv3 alert handshake failure" under Python

I have a REST API written in Java running under JBoss. Recently we updated our JVM from 1.6 to 1.7. This started to cause issues with only our Python clients which were connecting. Intermittently, Python clients are getting handshake failures. …
Chuck M
  • 1,175
  • 3
  • 17
  • 26
7
votes
1 answer

Python httplib2, AttributeError: 'set' object has no attribute 'items'

I'm playing with the Python library httplib2. The following is my code. import urllib.parse import httplib2 httplib2.debuglevel = 1 http = httplib2.Http() url = "http://login.sina.com.cn/hd/signin.php" body = {"act": "1", "entry":…
Just a learner
  • 26,690
  • 50
  • 155
  • 234
7
votes
3 answers

How to update cacerts.txt of httplib2 for Github?

I am trying to use Github API with httplib2. But when I making requests to it's endpoints, it gives me following error: import httplib2 h = httplib2.Http() h.request('https://api.github.com/gists') # OUT: Traceback (most recent call last): # OUT: …
Bunyk
  • 7,635
  • 8
  • 47
  • 79
1
2 3
14 15