一、
from flask import Flask,Response,request
app=Flask(__name__,static_folder='static')
@app.route('/')
def index():
return 'var a="hellow"'
@app.route('/allow',methods=['get','post'])
def allow():
headers={
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Content-Type':'*'
}
uu=request.form
res=Response("allow",headers=headers)
print(123)
print(request.form['password'])
print(uu)
return res
@app.route('/jsonp')
def jsonp():
return '''function callback(){
return 'helloworld'
}
'''
app.run(port=80,debug=True,threaded=True)