Whoops I sent the last mail to soon...

I deleted the lines generating data in the example below...didn't seem
that interesting.

What I can't understand is from what I can tell from the docs, instead
of the cherrypy.response line I should be able to do
@expose(content_type='text/plain') but that doesn't work.  It just
sends it as text/html anyway.

But when I explicitly set it as below, it works fine.  Weird.  Any
thoughts?



On Jan 22, 1:15 am, "[email protected]" <[email protected]> wrote:
> Yes...that's what I've come up with...
>
> �...@expose()
>     def show_text_file(self, **kw):
>
>         cherrypy.response.headers['Content-Type'] = "text/plain"
>         return data[-500:]
>
> On Jan 22, 12:44 am, Remi Jolin - SysGroup <[email protected]>
> wrote:
>
> > Hello,
>
> > le 22.01.2009 06:41 [email protected] a écrit:> Hi...
>
> > > Under TG 1.0, I have a function that I'd like to return text/plain.
> > > I've read over the expose decorator docs and it seems like only json
> > > can avoid templates?  Is this true?
>
> > > Is there no way to just return either plain text, or even html
> > > bypassing a template engine?
>
> > what about something like
> > @expose()
> > def xxx(self):
> >     ...
> >     return "my plain text"
>
> > Perhaps, you'll to fix the Mime type also ?!
>
> > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to