Skip to content

Instantly share code, notes, and snippets.

@MeLight
Created June 16, 2015 09:00
Show Gist options
  • Save MeLight/25ddf4859d10d817f29a to your computer and use it in GitHub Desktop.
Save MeLight/25ddf4859d10d817f29a to your computer and use it in GitHub Desktop.
//-------- Client side
var my_array = ['a', 'b', 'c'];
$.get('/api/end_point', {arr: JSON.stringify(my_array)}, function(data) { //note that we stringify the array before sending it
//we assume everything went well on the server
}, 'json');
#--------- Server side
class ArrayRequestHandler(webapp2.RequestHandler):
def get(self):
recipe = Recipe.some_function_to_get_recipe()
recipe.steps = self.request.get('arr') #note, we save JSON as string (as we got it form the client)
recipe.put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment