Custom dynamic headers with lambda integration

I am returning a small csv file from a call via API gateway and I would like to dynamically set the filename but I cannot figure out how to do it.

If I hardcode the filename then it works ok when I set the content disposition, but ideally I would like to take one of the request parameters which is an ID used for the lookup and add this to the filename.

Firstly, is this even possible? All of my attempts end up with a literal string being rendered and there is no variable interpolation.

Here is an example of what I am trying to do:

integration: lambda
    Content-Type: "'text/csv'"
    Content-Disposition: "'attachment; filename=filename_$context.requestOverride.querystring.my_var_$context.requestTime.csv'"
    My-Header: context.path   

Can this be done and if so could someone show me how please?

You should be able to do it in code. The lambda response headers can be configured.

In golang code-
AWSresponse.Headers = map[string]string{“Content-Type”: “text/csv”}`

Yes but I am using lambda integration, is this still possible? I was under the impression this would work if I was using proxy integration (which I am not)?

Thanks for the reply!