I am taking in bunch of inputs from the user in html which I am then passing on to ajax query to get the response.
$.ajax({
url:"http://0.0.0.0:8080/getReport",
type:"GET",
data:JSON.stringify(out),
dataType:"json",
contentType:"application/json"
})
Here is the Flask code that serves the above request.
@app.route('/getReport', methods=['GET'])
def report():
return Response('this is a sample response')
The above method is not able to find the route to the 'report' with get. However, it is able to find it in POST request.
This is the log that I am getting
127.0.0.1 - - [25/Apr/2016 13:00:03] "GET /getReport?{%22insertion_id%22:%22%22,%22start%22:%22%22,%22end%22:%22%22} HTTP/1.1" 400 -
Bad Request.. What am I doing wrong here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…