Just started to use gdata (Python). Surprisingly, after setting up credentials correctly, I just get HTTP code 400, whenever I try to retrieve all files. Take a look into this code:
s = 'https://www.google.com/m8/feeds'
s = 'https://www.google.com/m8/feeds/contacts/default/full/'
client_secret = CLIENT_SECRET
client_id = CLIENT_ID
client = gdata.contacts.client.ContactsClient()
auth2token = gdata.gauth.OAuth2Token(
client_id = client_id,
client_secret = client_secret,
scope = s,
user_agent = "bla")
auth2token.authorize(client)
try:
feed = client.get_contacts()
except gdata.client.RequestError as e:
print e.args
print e.body
print e.headers
print e.message
print e.reason
print e.status
Unfortunatelly I always get error, no matter what the value of s
is. See the output of this code:
('Server responded with: 400, ',)
[('alternate-protocol', '443:quic,p=0.08'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('transfer-encoding', 'chunked'), ('accept-ranges', 'none'), ('expires', 'Fri, 01 Jan 1990 00:00:00 GMT'), ('vary', 'Accept-Encoding'), ('server', 'GSE'), ('pragma', 'no-cache'), ('cache-control', 'no-cache, no-store, max-age=0, must-revalidate'), ('date', 'Tue, 03 Mar 2015 02:12:08 GMT'), ('x-frame-options', 'SAMEORIGIN'), ('content-type', 'application/json')]
Server responded with: 400,
Bad Request
400
Any clue?
Thanks!