cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter REST - change response content-type

raphaelxavier
Explorer
0 Kudos

Hi experts, we have a special requirement in our project which the sender REST adapter has to send a PDF file in the response payload.


To achieve this, we've developed a java module to get the base64 string content from the payload and transform it into a byte[], and we've changed the payload data as follows:


payload.setContentType("application/pdf");
payload.setContent(bytes);


But when we call the service in the browser or any other client, we realized that the content-type in the response still "application/json".


Does anyone has tried to change the content-type for the adapter REST before? Is this kind of operation allowed in adapter REST?

Thank you for the help.

Rgds. Raphael


View Entire Topic
maheswarareddykonda
Active Contributor
0 Kudos

Hi Raphael,

Rest channel accept only application/xml and application/json

please read Ryan Crosby comment in link

Regards,

Maheswarareddy