Adding custom http headers to tRESTResponse

Six Stars

Adding custom http headers to tRESTResponse

Is it possible to add custom http headers to a tRESTResponse? I know that there is an enhancement request for doing this and it is still not in progress of being worked on (https://jira.talendforge.org/browse/TESB-6057). I would need this so that I can implement CORS. I do not wish to use JSONP since it would require more logic and be more of a "work-around".
Could I add http headers using tGroovy or tJavaFlex?
Six Stars

Re: Adding custom http headers to tRESTResponse

This enhancement has been implemented in version 5.2. See tRESTResponse/Advanced Settings to add manual http headers.
For CORS, just add the http header "Access-Control-Allow-Origin" with the value "*" to the tRESRResponse component.
Highlighted
One Star

Re: Adding custom http headers to tRESTResponse

Dear Talend ESB Team,
Using last version of 5.6 in component TRestResponse and adding "Access-Control-Allow-Origin" with the value "*" , we still are getting the same CORS problem.
Do you know why header is not seen at http response?
 
One Star

Re: Adding custom http headers to tRESTResponse

We restarted Runtime ESB and it worked.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download