Created
June 1, 2015 11:39
-
-
Save MeLight/5e11d88657f8619807ee 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 | |
import json | |
class ArrayRequestHandler(webapp2.RequestHandler): | |
def get(self): | |
python_list = json.loads(self.request.get('arr')) #we rebuild the JSON from the string received | |
single_var = python_list[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment