mcteamdev16 / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

TaskQueue API - content length not setting for lease function #312

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
service = build('taskqueue', 'v1beta2', http=auth_http)
r = service.tasks().lease(project=PROJECT_ID, taskqueue=QUEUE_NAME, numTasks=1, 
leaseSecs=100)
tasks = r.execute()

What is the expected output? What do you see instead?
Should work, instead i got HttpError 411 - returned "Length Required"

What version of the product are you using? On what operating system?
Macos, Python 2.7, google-api-python-client v1.2

Please provide any additional information below.
Hack fix for that is:
r = service.tasks().lease(project=PROJECT_ID, taskqueue=QUEUE_NAME, numTasks=1, 
leaseSecs=100)
r.headers['content-length']="0"
tasks = r.execute()

Original issue reported on code.google.com by piotr.za...@unit9.com on 11 Nov 2013 at 12:13