python3 flask restful 传入中文参数 乱码
#-*-coding:utf-8-*-"""CreatedonThuMar2208:59:542018@author:XAYQ-WangChenxi#-*-coding:...
# -*- coding: utf-8 -*-"""Created on Thu Mar 22 08:59:54 2018@author: XAYQ-WangChenxi# -*- coding: utf-8 -*-from flask import Flaskfrom flask_restful import reqparse,Api, Resourceapp = Flask(__name__)api = Api(app)parser = reqparse.RequestParser()parser.add_argument('task')class TodoList(Resource): def post(self): args = parser.parse_args() str1 = args['task'] print (str1) return str1,201api.add_resource(TodoList, '/todos')if __name__ == '__main__': app.run(debug=True)通过在cmd执行以下语句curl http://localhost:5000/todos -d "task=财汇端" 返回的值是\ufffd\中文乱码,我想正常返回中文,请问该如何改进
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询