json data returned Response 14 bytes [200 OK] instead of displaying JSON data on flask app
i am now currently facing a problem where i cant display the json data onto the flask view. whenever i got the data and trying to display it on the view, i am not able to display the json data.
instead of returning the data in json form it returns nothing but Response 14 bytes [200 OK]. where am i doing it wrong? here's the code i have.
@app.route('/prediction', methods=['GET','POST'])
def predict():
if request.method == 'GET':
data1 = request.get_json()
return render_template('index.html', data = jsonify(data1))
as for html i have a simple one which is this
<!DOCTYPE html>
<html lang="en">
<head>Prediction Test</head>
<body>
<div>{{data}}<开发者_开发问答;/div>
</body>
</html>
and the response i have is this:
Prediction Test
<Response 14 bytes [200 OK]>
精彩评论