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
0
votes
1 answer

Post request failing with python httplib2, works with curl

I'm trying to request access tokens from the fitbit API, but it keeps returning 401 Unauthorized status, even though I configure the request identical to a corresponding curl query - which succeeds. The error message returned says:…
jensmtg
  • 506
  • 5
  • 23
0
votes
3 answers

How to send email attachments using python httplib2 with Mailgun

I am using httplib2 with the Mailgun API to send an email attachment which I downloaded using the Google Drive, the email is sending but without attachments.. below is my code.. DRIVE = discovery.build('drive', 'v3', http=http_auth) request…
Isaac
  • 296
  • 1
  • 4
  • 14
0
votes
1 answer

httplib2.IncompleteRead: AttributeError: 'module' object has no attribute 'IncompleteRead'

I've been using a script that was no longer maintained, which downloads your entire Google Drive to your local storage. I mananged to fix a few issues to do with depreciation, and the script seemed to be running smoothly, however, as seemingly…
Tom N
  • 104
  • 12
0
votes
1 answer

Python requests PUT method creates a zero byte file

I am trying to upload a file with PUT using the requests module in python. my code is this: with open(file, 'rb') as payload: r = requests.put(url, data=payload, auth=('username', 'password')) The file is created, I am getting a response 200,…
Cobra Kai Dojo
  • 1,018
  • 2
  • 12
  • 25
0
votes
3 answers

Can't connect to google directory-api using proxy with httplib

I have my scripts ready to manage users in google however I can't find anyway to use a proxy with httplib2, as such I am constantly switching to mobile to avoid doing tasks by hand. For refrence all code comes from the quickstart :…
Matt
  • 501
  • 3
  • 13
0
votes
1 answer

GAE not finding httplib2

I'm trying to run the sample code https://github.com/google/google-api-python-client/tree/master/samples/appengine from the Google API Python Client on the Google Cloud platform. After starting the test app I'm seeing this error: ImportError: No…
Vladimir
  • 417
  • 5
  • 20
0
votes
1 answer

Multiple URL requests to API without getting error from urllib2 or requests

I am trying to get data from different APIs. They are received in JSON format, stored in SQLite and afterwards parsed. The issue I am having is that when sending many requests I eventually receive an error, even if I am using time.sleep between…
J0ANMM
  • 7,849
  • 10
  • 56
  • 90
0
votes
0 answers

Cannot connect to Skyscanner API using httplib2 in Python

I'm trying to establish a connection via an http request to the Skyscanner API. I'm aware there is an ad hoc library in python to retrieve data from their API, but for learning purposes I want to create my own using httplib2. I wrote the following…
Gianluca
  • 6,307
  • 19
  • 44
  • 65
0
votes
1 answer

using httplib2 Python to create REST POST listener

I found woefully few samples of httplib2 using the following template defined in the httplib2 documents. The following (GETs) work (and I now need to implement POST methods using it) URLS = ( '/', 'PingLocal', '/ping', …
user3213604
  • 407
  • 1
  • 7
  • 18
0
votes
1 answer

Python urlopen and httplib both are unable to return the actual html of the page

I am trying to read information from this page: http://movie.douban.com/subject/20645098/comments and use the following to find all the comment items. comment_item = soup.find_all("div", {"id":"comment"}) However, I was unable to get anything…
YAL
  • 651
  • 2
  • 7
  • 22
0
votes
1 answer

Not understanding what's going on with my python code and httplib2 package

I seem to be getting different results when running my script normally or entering it in my cmd. Here's the full code: import httplib2, re def search_for_Title(content): searchBounds = re.compile('title(.{1,100})title') Title =…
Nimitz14
  • 2,138
  • 5
  • 23
  • 39
0
votes
1 answer

i get this error --- > EOFError: EOF when reading a line

i get this error everytime i run my code code = raw_input('Enter verification code: ').strip() EOFError: EOF when reading a line i get this error everytime i run my code code = raw_input('Enter verification code: ').strip() EOFError: EOF when…
WAYSER
  • 107
  • 1
  • 10
0
votes
1 answer

Python httplib2 exception not thrown as expected

I wrote a script to run python http request functions The code is as following: header = {'Content-Type': 'application/x-www-form-urlencoded'} data = {'username':"admin", 'passwd':"passwd"} data = urllib.urlencode(data) http = httplib2.Http()…
Chang May
  • 165
  • 1
  • 10
0
votes
1 answer

Help converting code using httlib2 to use urllib2

What am I trying to do? Visit a site, retrieve cookie, visit the next page by sending in the cookie info. It all works but httplib2 is giving me one too many problems with socks proxy on one site. http = httplib2.Http() main_url =…
ThinkCode
  • 7,841
  • 21
  • 73
  • 92
0
votes
2 answers

how do you get links with certain words using beautifulsoup

This code is for getying links from html webpages, but I want to make it give me only the links with certain words. For instance, only links that have this word in there urls: "www.mywebsite.com/word" My code : import httplib2 from BeautifulSoup…
theasker2000
  • 29
  • 4
  • 11