tRestRequest JSON POST not working

Five Stars

tRestRequest JSON POST not working

I'm trying to POST a simple JSON object to tRestRequest and i'm not able to get those JSON fields in the service.

 

It is very very simple rest call, not sure why it is not working.

 

I was trying to see some examples all are using tXMLMap, i dont know why. No simple examples using JSON post call.

 

Please find the attached images.

 

I'm using Postman to call my rest service, the rest service is getting called, but it is not able to convert / pass the JSON content to next stage.

 

 


Accepted Solutions
Seventeen Stars

Re: tRestRequest JSON POST not working

The result of the tRESTRequest component is NOT a parsed json-attribute, instead the component returns the json document it self.

You expect in your job to get the json attributes but this does not work. You need to send the request payload (use the String content) to a tExtractFieldJSON component to parse the json.


All Replies
Eight Stars

Re: tRestRequest JSON POST not working

No images are shown. Can you upload the job again so someone can help?
Five Stars

Re: tRestRequest JSON POST not working

are you not able to see the attachments? because i can.

 

If not , could you please let me know is there any Talend community help page showing the example of such a simple tRestRequest component in working stage?

 

If i write a simple web service call using Spring boot it will not take more than five minutes to make it working... but i'm trying this for more than a day.

Seventeen Stars

Re: tRestRequest JSON POST not working

The result of the tRESTRequest component is NOT a parsed json-attribute, instead the component returns the json document it self.

You expect in your job to get the json attributes but this does not work. You need to send the request payload (use the String content) to a tExtractFieldJSON component to parse the json.

Four Stars

Re: tRestRequest JSON POST not working

Hi jilolling,

 

I am also facing similar issue. But even when I am trying to use tExtractFieldJSON it doesnot parse the JSON and fail use the request parameters.

 

Could you please share the steps to use tExtractFieldJSON to parse json request payload

Seventeen Stars

Re: tRestRequest JSON POST not working

Parsing the request parameters is a matter of the tRESTRequest component.