Five Stars

How to get the response body when calling an API

Hi,

 

I am using tfileFetch to call an API to upload a file using POST method. It works fine but when it throws an error it only returns the header but I need to get the response body. How can I get the response body? Is there any other component or java code I can use?

 

Thanks

Tags (3)
2 REPLIES
Community Manager

Re: How to get the response body when calling an API

Hi
Is it a Restful or SOAP WS? Have you tried the tRest (for restful WS) or tSOAP (for SOAP WS) components?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: How to get the response body when calling an API

Hi Shong,

 

It is a restful WS. Using the tRest component, I think we can't pass parameters. I need to pass both headers and parameters and get the error response body. Any ideas?

 

Thanks