flask 请求方式

from lxml import etree
import requests
import requests
from flask import Flask, render_template,request,make_response
from lxml import etree
import  re
from urllib import parse
from flask import json
app=Flask(__name__)

@app.route("/audio/alla",methods=["get","delete"])
def get_home_pagea():
    if request.method=='DELETE':
        return "delete"
    else:
        return "404"
@app.route("/audio/alla1",methods=["delete"])
def get_home_pagea1():
    arg1= request.args.get('arg1')
    arg2= request.args.get('arg2')
    return str(int(arg1)*int(arg2))
@app.route("/audio/alla1",methods=["get"])
def get_home_pagea2():
    arg1= request.args.get('arg1')
    arg2= request.args.get('arg2')
    return arg2 is None and arg1 is not None
if __name__ == '__main__':
    app.run(debug = True,host="127.0.0.1" ,port=8887)
上一篇:Python学习笔记


下一篇:为什么推荐std::string而不是char*