lyangas commited on
Commit
4a7adf1
1 Parent(s): 3a4727b

get data from req

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -39,13 +39,13 @@ def test_get():
39
 
40
  @app.route("/test", methods=['POST'])
41
  def test():
42
- data = request.__dict__
43
  return {'response': data}
44
 
45
  @app.route("/predict", methods=['POST'])
46
  def read_root():
47
- print(request.__dict__)
48
- data = request.form
49
  text = str(data['text'])
50
  top_n = int(data['top_n'])
51
 
 
39
 
40
  @app.route("/test", methods=['POST'])
41
  def test():
42
+ data = request.json
43
  return {'response': data}
44
 
45
  @app.route("/predict", methods=['POST'])
46
  def read_root():
47
+ data = request.json
48
+ print(data)
49
  text = str(data['text'])
50
  top_n = int(data['top_n'])
51