FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

Two different headers for the same route

Open pcmanprogrammeur opened this issue 3 years ago • 0 comments

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.

pcmanprogrammeur avatar Apr 13 '22 09:04 pcmanprogrammeur