How to get the response body when calling an API

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

Highlighted
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 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog