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
3
votes
0 answers

httplib2 cache file name problems

I am using httplib2 on Windows. I have a URL with lots of & delimited parameters in it. When I give a cache to Http(), and then request the URL, I get: FileNotFoundError: [Errno 2] No such file or directory: '.cache\\[MY URL]' If I use /.cache as…
Superbest
  • 25,318
  • 14
  • 62
  • 134
3
votes
1 answer

python - " Import error no module named httplib2" in only some files

When I import the httplib2 in quickStart.py and run it using terminal It works. Now I import quickStart in another file main.py(Google app engine web app python file) and try loading the page via localhost it shows "Import error no module named…
Satwik
  • 1,281
  • 4
  • 18
  • 31
3
votes
3 answers

Httplib2 - AttributeError: 'NoneType' object has no attribute 'makefile'

How do I fix this? PS: On googling, I found that this is some httplib2 bug but I didn't understand how to use the patches people have provided. Traceback (most recent call last): File "alt_func.py", line 18, in func(code) File…
zubinmehta
  • 4,368
  • 7
  • 33
  • 51
3
votes
0 answers

httplib2 can I get original response headers

Here is my sample code: http.debuglevel=1 ... response, content = conn.request(target,method,body,headers) print response here is the result from the fact I am in debug (note I just left few lines here) reply: 'HTTP/1.1 200 OK\r\n' header: Pragma:…
TestMechanic
  • 163
  • 1
  • 1
  • 11
3
votes
1 answer

python, send many HTTP requests through one network connection

I'm working on a python 2.7 script that must check in a Fedora Commons repository for the existence of some data in 20'000 objects. Basically this means sending 20'000 HTTP requests to 20'000 different urls on the repository (that runs on a Tomcat…
nIcO
  • 5,001
  • 24
  • 36
3
votes
1 answer

HTTP Post Using httplib2 Error

I am trying to get a new access token by using a refresh token as described by Google here. Google says I need to make a HTTP request. I had no clue how to do that, so I looked up how to do it from here. However, I must be doing the post incorrectly…
LucasS
  • 689
  • 3
  • 14
  • 24
3
votes
1 answer

Foursquare API Python Access Token Error

I am trying to get access token from Foursquare API via Python. I'm using the wrapper from https://github.com/mLewisLogic/foursquare And, followed the same approach mentioned on http://log.hckr.org/2012/02/01/foursquare-api-wrapper-for-python But,…
Zero
  • 74,117
  • 18
  • 147
  • 154
3
votes
1 answer

Downloading compressed content over HTTP using Python

How do I take advantage of HTTP 1.1's compression when downloading web pages using Python? I am currently using the built-in urllib module for downloading web content. Reading through the documentation I couldn't find any information that is indeed…
Philip Fourie
  • 111,587
  • 10
  • 63
  • 83
3
votes
6 answers

Command line URL fetch with JavaScript capabliity

I use curl, in php and httplib2 in python to fetch URL. However, there are some pages that use JavaScript (AJAX) to retrieve the data after you have loaded the page and they just overwrite a specific section of the page afterward. So, is there any…
Val Neekman
  • 17,692
  • 14
  • 63
  • 66
3
votes
1 answer

Implementing a custom Python authentication handler

The answer to a previous question showed that Nexus implement a custom authentication helper called "NxBASIC". How do I begin to implement a handler in python? Update: Implementing the handler per Alex's suggestion looks to be the right approach,…
Rich Seller
  • 83,208
  • 23
  • 172
  • 177
2
votes
3 answers

How do I save a file using python's httplib2?

I can run the following code: import httplib2 h = httplib2.Http('.cache') response, content = h.request('http://2.bp.blogspot.com/-CXFfl9luHPM/TV-Os6opQfI/AAAAAAAAA2E/oCgrgvWqzrY/s1600/cow.jpg') print(response.status) with open('cow.jpg', 'wb')…
user1106278
  • 747
  • 1
  • 9
  • 18
2
votes
2 answers

Error opening ssl connection using httplib2

I am using httplib2 for opening up an ssl connection. Following is the code. import httplib2 if __name__=='__main__': conn = httplib2.Http(disable_ssl_certificate_validation=True) conn.add_certificate('serverkey.pem', 'servercert.pem', '') …
n3o
  • 2,795
  • 5
  • 24
  • 37
2
votes
2 answers

Remove certain parts of web page using beautifulsoup

I am trying to read links from a page, but I am getting more links than desired. What I am doing is: http = httplib2.Http() status, page= http.request('page address') soup = BeautifulSoup(page,'html.parser', parse_only=SoupStrainer('a')) For link in…
2
votes
1 answer

httplib2.ServerNotFoundError: Unable to find the server at accounts.google.com

I have been struggling with this problem for a while now and have scoured the internet but am still unable to solve it. I am trying to run a python script to access a google sheet from my local machine at work (so may be firewall issues). Whenever…
Jacob
  • 91
  • 1
  • 2
  • 4
2
votes
1 answer

appcfg.py request_logs certificate verify failed (_ssl.c:661)

We've been using appcfg.py request_logs to download GAE logs, every once in a while it throws the error: httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) But after a few times trying it works out,…
Khaled
  • 907
  • 1
  • 8
  • 18