This scenario describes a two-component Job that uses the GET method to retrieve information from the server end and writes the response to a local file as well as to the console.
In the Integration perspective of the Studio, create a Job from the Job Designs node in the Repository tree view.
For further information about how to create a Job, see the Talend Studio User Guide.
Drop the following components from the Palette onto the design workspace: tHttpRequest and tLogRow.
Connect the tHttpRequest component to the tLogRow component using a Row > Main connection.
Double-click the tHttpRequest component to open its Basic settings view and define the component properties.
Fill in the URI field with "http://192.168.0.63:8081/testHttpRequest/build.xml". Note that this URI is for demonstration purposes only and it is not a live address.
From the Method list, select GET.
Select the Write response content to file check box and fill in the input field on the right with the file path by manual entry, D:/test.txt for this use case.
Select the Need authentication check box and fill in the user and password, both tomcat in this use case.
Then you can run this Job.
The tLogRow component is used to present the execution result of the Job.
If you want to configure how the result is presented by tLogRow, double-click the component to open its Component view and in the Mode area, select the Table (print values in cells of a table) check box.
Press F6 to run this Job.
Once done, the response information from the server is saved and displayed.