I want pass one parameter in a Url (to update one of many paramaters contained by my URL) like this:
httpGet.setURI(new URI(url/user?"nickname"="John")
ServerSide in Python:
class GetInfo(BaseHandler):
def Get(self):
nickname = self.get_argument("nickname")
gender = self.get_argument("gender")
logging.info(nickname)
logging.info(gender)
application = tornado.web.Application([
(r"/", MainHandler),
(r"/user", GetInfo),
])
The server told me that I can’t do this because the parameter “gender” is missing.
How can I do?
Thanks
First your URI seems to be wrong.And if you test from emulator to webserver and you use both on the same machine, use the IP address of the server instead of something like
localhostor127.0.0.1Example:
Edit:
The answer to this OP is below:
it seems from the example at tornadoweb.org/documentation that you can set a default value. So you can try something like
gender = self.get_argument("gender",None). So gender should be set toNoneif you dont pass anygenderparameter in the query string