so i want to make something like a progress bar in js(react) and in python(flask)
and I want to return to the react that he needs to change the progress bar.
React:
fetch(pythonUrl+"/NormalMyProgress",
{
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams(
{
"text" : "hello"
})
})
.then(resp => resp.json())
.then(data =>
{
setProgressBarValue(data.data)
})
python:
@app.route('/NormalMyProgress',methods=["POST"])
def home_normal():
txt = request.form.get('text')
print(txt)
for i in [0,25,50,100]
return jsonify({"data":i})