Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ajax:
- function ajaxFunction(point,route_code){
- console.log(route_code)
- $.ajax({
- type : 'POST',
- method: 'POST',
- url : "/new_coords",
- contentType: 'application/json',
- headers: {'Accept':'application/json'},
- data : {code: route_code},
- success: function(data){
- //new_coordinates(point,)
- console.log(data)
- }
- });
- }
- Flask router:
- @app.route("/new_coords",methods=['POST'])
- def new_coords():
- print(request.data) //менял на request.json, ошибка 400
- //выводит b'code=1232456'
- return 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement