阿里云记录保存

恭喜您,试用ECS创建成功

实例ID:i-bp1h36cszlkbxbf5gqee

您的免费试用已正式开启!立即登录ECS控制台,完成新手任务,即可快速上手ECS。ECS实例创建需要1-5分钟,请您耐心等待。

121.43.231.59 公网

172.25.37.106 私网

root/Zhangren1991

vnc密码

Zhang1

公网:121.40.41.152
私网:172.25.37.107
用户名:root
密码:Zhangren1991

谷歌邮箱:

[email protected]

from flask import Flask, render_template, send_file

app = Flask(__name__)


@app.route('/')
@app.route('/', defaults={'path': ''}, methods=['GET', 'POST'])
@app.route('/')
def catch_all(path):
    print('request path is: %s' % path)
    path = str(path)
    if path.endswith(".apk"):
        print('download path is: %s' % path)
        return send_file(path_or_file="zyytest.apk", download_name='zyytest.apk', as_attachment=True,
                         mimetype='application/pdf')
    elif path.endswith(".jpg") or path.endswith(".png"):
        print("request jpg path is :" + path)
        return send_file("zyytest.jpg", download_name='zyytest.jpg', mimetype="image/gif")
    else:
        print("other request path is: " + path)
        return "no such path!"


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=80)

C:\Users\lenovo>curl -X POST -H "Content-Type: application/json" -d '{"key1":"value1","key2":"value2"}' http://127.0.0.1:5000/upload_data
Received!

英文修改网站

Sign in – InstaText | Write like a native speaker

你可能感兴趣的:(阿里云,云计算)