Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sirasit_Mahawanitwong
Contributor II
Contributor II

tRestClient return unreadable response

I created the simple job to call the web api via tRestClient, POST method with following details:

0695b00000JOUDdAAP.png 

0695b00000JOUDsAAP.png 

And here's the result:

0695b00000JOU89AAH.png 

So. I enable log message and here's the log:

Oct 05, 2021 2:00:08 AM org.apache.cxf.interceptor.LoggingOutInterceptor

INFO: Outbound Message

---------------------------

ID: 1

Address: https://api.nso.go.th/api/v1.0/branch10/dataset/278?year=2564&year=2564

Http-Method: POST

Content-Type: application/json;charset=utf-8

Headers: {Content-Type=[application/json;charset=utf-8], Accept=[*/*], Authorize=[authorize-string]}

--------------------------------------

Oct 05, 2021 2:00:09 AM org.apache.cxf.interceptor.LoggingInInterceptor

INFO: Inbound Message

----------------------------

ID: 1

Response-Code: 200

Encoding: ISO-8859-1

Content-Type: application/json

Headers: {Access-Control-Allow-Headers=[Content-Type], Access-Control-Allow-Methods=[GET,POST,PUT,DELETE,OPTIONS], Access-Control-Allow-Origin=[*], Access-Control-Credentials=[true], Cache-Control=[no-cache], content-encoding=[GZip], Content-Length=[3807], content-type=[application/json], Date=[Mon, 04 Oct 2021 19:00:09 GMT], Expires=[-1], Pragma=[no-cache], X-Powered-By=[ASP.NET]}

 

I also tried to call the same api with Postman and its result turn out fine (Noted: the results are in Thai characters).

I suspected that this issue has something to do with Talend or Java ,but I could not figure it out.

BR,

Sirasit

Labels (3)
2 Replies
gjeremy1617088143

Hi, @Sirasit Mahawanitwong​ , you have an encoding problem, if postman send you fine result copy the same header in trestclient (like charset header), by default jvm charset is utf 8 you can also change this parameter.

Send me love and kudos

Sirasit_Mahawanitwong
Contributor II
Contributor II
Author

Hello again.

Thank you for the response!

I did checked the header which Postman use to request. There is no mention about charset in the header.

 

0695b00000JP84HAAT.png