[google-appengine] Remove surrounding quotation marks
I am attempting to write a JSONP application and think that it is not working because the JSON my code is returning has surrounding quotation marks. For example when I call the webapp using http://rest-client.googlecode.com/ it returns the following callbackfunctionname({'Last': 'Doe', 'First': 'John'}) Comparing this to a public url I am using which works the only difference I can see is the surrounding quotation marks. Does anybody know how I can remove these? Thanks Jim def get(self): json = {'Last': 'Doe', 'First': 'John'} json = self.request.get(callback) + '(' + json + ')' logging.debug(json= + json) self.response.set_status(200) self.response.headers['Content-Type'] = application/json self.response.headers['Content-Length'] = len(json) self.response.content_type = application/json simplejson.dump(json, self.response.out) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Remove surrounding quotation marks
I am attempting to write a JSONP application and think that it is not working because the JSON my code is returning has surrounding quotation marks. For example when I call the webapp using http://rest-client.googlecode.com/ it returns the following callbackfunctionname({'Last': 'Doe', 'First': 'John'}) Comparing this to a public url I am using which works the only difference I can see is the surrounding quotation marks. Does anybody know how I can remove these? Thanks Jim def get(self): json = {'Last': 'Doe', 'First': 'John'} json = self.request.get(callback) + '(' + json + ')' logging.debug(json= + json) self.response.set_status(200) self.response.headers['Content-Type'] = application/json self.response.headers['Content-Length'] = len(json) self.response.content_type = application/json simplejson.dump(json, self.response.out) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---