File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -3691,6 +3691,30 @@ create you'll need to add new locale files in the tracker home under a
3691
3691
developer's guide <developers.html#extracting-translatable-messages>`_ to
3692
3692
create the locale files.
3693
3693
3694
+ Setting the Type of the Returned Data
3695
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3696
+
3697
+ Roundup processes a template and uses the name of the template to
3698
+ determine the Content-Type MIME header that is returned. For
3699
+ ``issue.index.html` it would return ``text/html``. Similarly a file
3700
+ named ``issue.atom.xml`` (an rss feed) would have a type
3701
+ of``application/xml``. A file named 'issue.json' would have type
3702
+ ``application/json``.
3703
+
3704
+ However as of Roundup 2.4.0 you can set the type of the file by
3705
+ calling::
3706
+
3707
+ request.client.setHeader('Content-Type', 'application/atom+xml')
3708
+
3709
+ from your template. For TAL based templates, something like this::
3710
+
3711
+ <tal:x tal:replace="python:request.client.setHeader(
3712
+ 'Content-Type', 'application/atom+xml'
3713
+ )"/>
3714
+
3715
+ will set the Content-Type header. The header name is case sensitive,
3716
+ so use capital letters as shown. If you don't you end up with multiple
3717
+ Content-Type definitions returned to the browser.
3694
3718
3695
3719
Displaying Properties
3696
3720
---------------------
You can’t perform that action at this time.
0 commit comments