如何记录期望在value
字段中显示的输入正文,以便用户知道要发布什么?目前使用以下数据:
{
"customer_id": "",
"service_id": "",
"customer_name": "",
"site_name": "",
"service_type": ""
}
我们可以用上面的json默认填充值吗?
代码:
post_parser = reqparse.RequestParser()
post_parser.add_argument('database', type=list, help='user data', location='json')
@ns_database.route('/insert_user')
class database(Resource):
@ns_database.expect(post_parser)
def post(self):
"""insert data"""
json_data = request.json
customer_id = json_data['customer_id']
service_id = json_data['service_id']
customer_name = json_data['customer_name']
site_name = json_data['site_name']
service_type = json_data['service_type']