'perform patch request using trestclient component which contains json object in request

I'm trying to call trestClient component in talend. But trestClient is failing with error message of "javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type".

i'm trying to pass json request to trestclient component. Job

Error

Request

From textracJson component ,extracting recordiD and json object to pass to trestClient component.



Solution 1:[1]

The issue is caused by the tExtractJSONField component. You want to pass JSON into your tRestClient component, but tExtractJSON reads your JSON from the previous tWriteJSONField component converts it back to a Talend data flow. Remove this component and connect tWriteJSONField to tRestClient directly and connect your schema accordingly (check the input schema in tRestClient to see they're connected and have the right data types). To ensure this, best is to use a tMap with output string and map the JSON as a string to that column.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Adrian