How to get the response body when calling an API

Highlighted
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

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 

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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 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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads