#!/usr/local/bin/python3 # -*- coding:utf-8 -*- import json import re from flask import abort, jsonify, Flask, request, Response app = Flask(__name__) # 增加配置,支持中文显示 app.config['JSON_AS_ASCII'] = False tasks = { "code": 0, "msg": "OK", "data": { "waybillNumber": "1526351", "serviceMode": "10", "waybillStatus": "10", "deliveryAbbreviationAddress": "深圳", "pickupAbbreviationAddress": "深圳" }, "traceId": "dp1r" } @app.route('/task', methods=['GET','POST']) def get_task(): return jsonify(tasks) if __name__ == '__main__': app.run( host = '0.0.0.0', port = 6868, debug = True )