I am creating a very simple dashboard for automating a task. Security is not a concern here because I am only local hosting.
JQuery Code
$.post("/approve", data={"title":title,"content":content}, success=function(){
window.location.reload(true)
});
Flask Code
@app.post('/approve')
def approve_topic():
args = request.args
print(args)
json.dump(args, open("topics/"+uuid4().hex+".json", "w"))
return {"status":"clear"}
Result (the JSON file)
{}
Expected Result
{"title":"whatever the title is", "content":"whatever the content is"}
Any idea why this is happening? The first time I ran this it worked just fine, but now no matter what I reset or what I do it won't work.