search

Home  >  Q&A  >  body text

python3 通过bottle获取请求参数但中文是乱码

from bottle import route, run, template, request


@route('/', method='GET')
def do_json():
    str = 'your request msg is %s %s %s' % (request.params['message'], request.params['age'], request.params['sex'])
    print(str)
    return {'respon':str}

run(host='localhost',port=8080, debug=True,reloader=True)
阿神阿神2865 days ago840

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:22:09

    • Replace it with this method:request.query.(请求参数字典的key值)

    
    request.query.message
    

    reply
    0
  • Cancelreply