I’m using webapp with Google App Engine.
I recently added a call to request.get('variable_name'). This worked fine, but completely changed the contents of request.body.
Upon closer examination, it looks like if I do not make a call to request.get(), then request.body yields text without any url formatting. But after a call the request.get(), request.body now contains text that includes URL formatting (a lot of ‘%’ signs, etc…).
Am I using webapp wrong? should I not be mixing and matching these two methods for information retrieval?
Here is some sample code:
class profiles_resource(webapp.RequestHandler):
def post(self):
# Value of request.body in debugger: 'str: {"query":"SELECT..."
token = self.request.get('token')
# Value of request.body in debugger: '%7B%22query%22%3A%22SELECT..."
request.getlooks for request parameters in both the query string and the body of the request, assuming the body is formencoded. If you intend to read the body directly, do not useself.request.getorself.request.POST.