You should use the response object:

  def get(self):
    self.response.headers['Content-Type'] = 'text/plain'
    self.response.out.write('your json')

Cheers,
Alex
--
www.muspy.com

On Dec 29, 9:19 am, Chen Harel <[email protected]> wrote:
> I'm trying to create a data table in an appengine, and send it back to
> a user.
> The user requests the data table using GET method, and I use
>
> class MainPage(webapp.RequestHandler):
>   # This function is invoked when a user sends a get request
>   def get(self):
>     self.response.out.write("...")
>
> To give him the response.
> The only problem is, that for visualizations, the tutorial states that
> the response should return:
> print "Content-type: text/plain"
> print
> print data_table.ToJSonResponse(columns_order=("name", "salary",
> "full_time"),
>                                 order_by="salary")
>
> (No <html> stuff...)
>
> But when I use it, I get the headers spilled into my response.
>
> What is the best way to send text/plain response from get request?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to