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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I get the URL passed in the tRESTClient

Hi Talend Community,

 

I have a rest service using tRESTClient that send parameters (header and body) via a REST GET call.

How can I see the URL being executed in its total string format.

tLogRow only shows the result set returned

 

Thanks

Labels (4)
18 Replies
Anonymous
Not applicable
Author

Is your URL hard coded? If so, you should probably change that. Add it to a context variable. If you do that, you can change it without having to change the job and recompile it. You can also make use of the context variable in other areas quite easily.  

Anonymous
Not applicable
Author

Hi 

 

The URL is not hardcoded, if I understand correctly - or is there something specific your are referring too?

 

Please see my config in the original post (screen captures).

Thank you 

Anonymous
Not applicable
Author

How can I add the context variable to display the URI on execution?

Anonymous
Not applicable
Author

You can use a tJava.....

System.out.println("My URL is: "+context.URL);

Or you can add it to a column in a tMap (for example) and use a tLogRow

Anonymous
Not applicable
Author

I placed the tJava with code specified after my tRestClient and got :

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	URL cannot be resolved or is not a field

0683p000009LvK7.png

Anonymous
Not applicable
Author

Ah I see. Replace the tJava with a tMap. Map the input columns to the output. Add an output column and put.....

context.URL

.....in the new column. Keep the tLogRow connected (refresh the schema) and you will see the URL printed by the tLogRow

Anonymous
Not applicable
Author

I might be misunderstanding

 

But here is my tMAP settings

0683p000009LvPY.pngI am not getting the URL in the output

Thanks

Anonymous
Not applicable
Author

You have to add it. By the way, you have duplicated all of your output columns

Anonymous
Not applicable
Author

I did add the variable, but no success

 

Do you perhaps have an example to better articulate?

Thanks