Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm using tHTTPClient component to call an API that responds with a JSON body but I use text response body format because the component crashes otherwise (JSON response body format).
On the TMC this is how the fields are looking after tExtractJSONField:
{"message":"�tre ant�rieure �"}]
Every accentuated (non Ascii it seems) character is replaced with ? for some reason.
The crash that happens when using JSON response body format:
Exception raised during HTTP call: (class java.lang.IllegalArgumentException) Despite the HTTP response status 200 OK, failing to read payload as JSON because of 'Unexpected IO exception on [lineNumber=1, columnNumber=1, streamOffset=0]': Here are the 222 first characters out of 222 of the HTTP response payloadSaid payload seems to be a JSON string (parsed as valid JSON when copied/pasted into any parser.
Hello,
Check the API/URL response headers – Confirm that the service returns a proper Content-Type (e.g., application/json, text/plain, etc.).
Add an explicit header in tHTTPClient – Set Accept: application/json (or the expected type) in HTTP headers.
Use tExtractJSONFields / tExtractXMLField after tHTTPClient to parse the body based on the actual content format.
If the API returns binary or unknown formats, write the raw response to file and parse manually.
Quick fix in tHTTPClient Advanced settings :Accept: application/json
If response still shows “unknown”, capture the full HTTP response (headers + body) and share it so we can determine the correct parser to use.
Thanks,
Gourav