flask cannot get ajax send post data
var data1= {
"name":"kikay",
}
var data = JSON.stringify (data1)
ajax ("POST"," http://localhost:5000/login",null, data1, function (r) {
console.log (data,r.status,r.response)
})
send ajax
@ app.route (" / login",methods= ["POST"])
def login ():
-sharpPOST
name=request.form.get("name")
print name
-sharp
if name=="kikay" :
print "dd"
return jsonify("kikay")
else:
print name
return jsonify("error")
flask error