Hey, I was running into the same problem. I hope this can solve your problem...
I'm developing a RESTful API to add new resources (records in DB)
I'm exposing the API using this code in my default.py controller:
@request.restful()
def api():
rest = module_api.RESTful(db, auth.user_id)
def POST(*args, **vars):
try: return rest.process_post(*args, **vars)
except module_api.Error as e:
raise HTTP(e.code)
return dict(POST=POST)
As you can see my POST request are processed by a function called process_post inside a module called module_api
I'm passing *args and **vars to process_post.
When I have your problem I was using an aux function inside my process_post function like this:
def process_post(*args, **vars):
# Aux function to map from args passed in the URL to real db resource
def map_resource(*args, **vars):
# some code
# some code calling map_resource(*args, **vars)...
Every POST I made resulted in:
raise HTTP(400, "Bad Request - HTTP body is incomplete") in line 252 form gluon/globals.py
Then I changed my code to something like:
def process_post(*args, **vars):
# Aux function to map from args passed in the URL to real db resource
def map_resource():
# some code using *args and **vars from process_post
# some code calling map_resource()...
I don't know if your are running into the same problem, but this solved my problem.
Greets!
Sebastián Tromer.