I've got a google-maps lookup with autocomplete on the client side - I'm trying to transfer the "place" object over to the server once the user selects it - I could parse it down client-side, but I figured it's easier to do server-side. I verified from the browser 'network' inspect that it is sending over the correct json object, but server side I can't get the right object. I've tried every permutation of request.* that I can find and either get None or a <module 'flask.json'>
which I know isn't right.
Code:
function sendplace() {
$('placebutton').click(function() {
var add1 = place;
console.log(place);
$.ajax({
url: '/new_place2',
data: JSON.stringify(place),
contentType: 'application/json;charset=UTF-8',
type: 'POST',
success: function(response) {
console.log(response);
},
error: function(error) {
console.log(error);
}
and server-side:
@app.route('/new_place2', methods=['GET', 'POST'])
def new_place2():
place = request.form.get('place')
print "address: ", place
return ("Success, (*&)er!")