Created
June 16, 2015 09:00
-
-
Save MeLight/25ddf4859d10d817f29a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------- 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