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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
IR-at-CGI
Contributor
Contributor

Problems with HTTP-Request

Hello @All,

 

I have created a small job to check how HTTP requests are working in Talend Open Studio 7.2 (Big Data) like this:0683p000009M9Gp.png

 

A context variable named "useHttpRequest_URL" is filled in tJava "Initialize Contexts" with URL "http://swapi.co/api/planets/3".

After that the tRest component will start for a HTTP-GET request and the response is shown in tLogRow:0683p000009MA4y.png

 

I got always a 403 error code (same with component tHTTPRequest), but if I try to reach this URL via browser (chrome, ie, firefox) or via python commands I got no error code ( status code: 200 ). 

 

I have no idea what's going wrong. Could you help, please?!

 

Best regards,

 

I.R.

 

 

 

 

 

 

Labels (4)
1 Solution

Accepted Solutions
uzix
Creator
Creator

hello @IR-at-CGI ,

 

 

i had issue using trest - handshake error

 

cant you use a trestclient ? 

 

i made a test and i can reach the url and get the payload.

0683p000009M9sl.png0683p000009M9mR.png

 

{

"name" : "Yavin IV" ,
"rotation_period" : "24" ,
"orbital_period" : "4818" ,
"diameter" : "10200" ,
"climate" : "temperate, tropical" ,
"gravity" : "1 standard" ,
"terrain" : "jungle, rainforests" ,
"surface_water" : "8" ,
"population" : "1000" ,
"residents" : [
] ,
"films" : [ ] ,
"created" : "2014-12-10T11:37:19.144000Z" ,
"edited" : "2014-12-20T20:58:18.421000Z" ,
"url" : "https://swapi.co/api/planets/3/"

}

View solution in original post

3 Replies
uzix
Creator
Creator

hello @IR-at-CGI ,

 

 

i had issue using trest - handshake error

 

cant you use a trestclient ? 

 

i made a test and i can reach the url and get the payload.

0683p000009M9sl.png0683p000009M9mR.png

 

{

"name" : "Yavin IV" ,
"rotation_period" : "24" ,
"orbital_period" : "4818" ,
"diameter" : "10200" ,
"climate" : "temperate, tropical" ,
"gravity" : "1 standard" ,
"terrain" : "jungle, rainforests" ,
"surface_water" : "8" ,
"population" : "1000" ,
"residents" : [
] ,
"films" : [ ] ,
"created" : "2014-12-10T11:37:19.144000Z" ,
"edited" : "2014-12-20T20:58:18.421000Z" ,
"url" : "https://swapi.co/api/planets/3/"

}

IR-at-CGI
Contributor
Contributor
Author

Hi uzix,

 

I made a test via tRestClient like your sample and it works, but first I had to change from "http:" to "https:".

 

Thanks your solution is fine for me. ;o)

 

Before you send me an answer I made the same test with another URL "https://www.metaweather.com/api/location/2487956/2018/11/28/". In this test component tHTTPRequest and tRest is used and both works successful.

 

Seems that there is a issue at server-side of "swapi.co". 

 

Any idea why these three components (tHTTPrequest, tRest, tRestClient) working different? 

 

Best regards,

 

I.R.

uzix
Creator
Creator

hi @IR-at-CGI ,

 

this link as a good response regarding the differences in components :

 

https://community.talend.com/t5/Design-and-Development/tRest-v-s-tRestClient/td-p/99188