Flask搭个服务器测试接口

Flask搭个服务器测试接口_第1张图片
下载.jpeg
#! python3 -coding:utf8-
from flask import Flask, jsonify

app = Flask(__name__)

data = [
    {
        "area": "芙蓉区",
        "city": "长沙市",
        "contactMobile": "13600000000",
        "contactName": "张三",
        "defaultFlag": "1",
        "detailAddress": "黄世龙街道167号",
        "id": "100",
        "provinces": "湖南省"
    },
    {
        "area": "芙蓉区",
        "city": "长沙市",
        "contactMobile": "136111111110",
        "contactName": "张三1",
        "defaultFlag": "0",
        "detailAddress": "黄世龙街道169号",
        "id": "101",
        "provinces": "湖南省"
    }
]


@app.route('/logistics/order/sendSms', methods=['GET'])
def get_sendSms():
    return jsonify({'data': data,'success':True,"msg":"短信发送成功"})


if __name__ == '__main__':
    app.run(debug=True,host='0.0.0.0', port=5000)
屏幕快照 2019-08-09 上午11.17.20.png

over

你可能感兴趣的:(Flask搭个服务器测试接口)