Most HTTP requests store additional parameters (for example, form values) in one of two places: the URL (as a query string ?foo=bar&spam=eggs ), or in the request body (when using a POST request and type mime application/x-www-form-urlencoded or multipart/form-data ).
Request.get_query_argument() looks for URL parameters, RequestHandler.get_body_argument() allows you to retrieve the parameters set in the POST body. The RequestHandler.get_argument() method retrieves either the body or the URL parameter (in that order).
You use Request.get_argument() when it is clearly not important for you where this parameter comes from, and your endpoint supports both GET and POST parameters. Otherwise, use one of the other methods to save it explicitly where your options come from.
The methods Request.get_*_argument use the values request.body_arguments and request.query_arguments (in this case request.arguments is their combination), it is decoded in Unicode. request.body - unprocessed unprocessed request object; and yes, there is a self.query equivalent containing a query string from a URL.
source share