>  Q&A  >  본문

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)
阿神阿神2740일 전777

모든 응답(1)나는 대답할 것이다

  • 巴扎黑

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

    • 이 방법으로 변경:request.query.(请求参数字典的key值)

    으아악

    회신하다
    0
  • 취소회신하다