Setting Headers for JSON & RSS Feeds?
Created 6 months ago by jzachary

Trying to create some JSON & RSS Feeds for Roku, Podcasts etc. I'm realizing now that I have no idea how to set the header types in Pyro. Previously, i've just created my php code to build the feed and set the headers and what not.

I'm kinda stumped at how I would do it correctly here. I just need to build the feed with simple logic in a theme file, I have some routes setup, I'm just not sure how to set the headers correctly. Would you use the page handler in the pages module? Can you set the header in the protected routes? I've read where you can set the response in the laravel route file (web.php) but that gives me errors. Do i need to set a route to a controller and have the controller return a view with the headers?

I feel like the simple easy way is having a page type set for RSS Feeds for example and extending any views into that gives you the correct page headers. But I'm not at all clear on how you would use or had handler for that or even if that's the correct use.

¯