Skip to content

Two different headers for the same route #2365

@pcmanprogrammeur

Description

@pcmanprogrammeur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions