FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 708 forks source link

Two different headers for the same route #2365

Open pcmanprogrammeur opened 2 years ago

pcmanprogrammeur commented 2 years ago

Hi, I would like to create a route to generate a csv but if there is an exception to generate a json response. Is it possible to return two different headers please ? I tried this without success

    format_listener:
        rules:
            - { path: .*/my_route/.*, prefer_extension: true, fallback_format: ~, priorities: [ json, csv ] }

Thanks for your help.