List Info

Thread: How to set a response header based on an argument to a page




How to set a response header based on an argument to a page
user name
2006-12-15 23:39:57
Hi All,

I have a need to create a page that, based on the arguments
passed into
it, will return different Content-Type headers (either
text/xml or
text/html).

Is this possible in cherrypy currently?  If so, can someone
point me in
the right direction?

Thanks,

Paul


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

How to set a response header based on an argument to a page
user name
2006-12-16 08:24:35
benchline wrote:
> Hi All,
> 
> I have a need to create a page that, based on the
arguments passed into
> it, will return different Content-Type headers (either
text/xml or
> text/html).
> 
> Is this possible in cherrypy currently?  If so, can
someone point me in
> the right direction?

Well you simply set the right Content-Type within your page
handler.

For instance:
cherrypy.response.headers['Content-Type'] = 'text/xml'

- Sylvain

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )