setting the data file from the Target_URL in tmp area

I recently started learning and using of apple script. Currently I am working on a problem to get the output data file from the server, and place it in tmp directory.

The code is like this:

property target_URL : “http://www.abc.com/appserver/lm/programs/index.jsp
tell application “Script Editor”
activate
display dialog “Welcome !!!.
‘Request Data’ to receive the data.
Click ‘Continue’ to proceed with the existing data file.” buttons {“Request Data”, “Continue”} default button 1
if the button returned of the result is “Request Data” then
open location target_URL
–Here I have the issue.How to get the result from the URL.
– This URL verifies for the valid user and Passwd and send the data file.

– I am not sure about how to handle the output from the URL.
set the_file to the result
try
–duplicate the_file to folder “private:tmp” of startup disk with replacing
on error message
display dialog errorMessage
end try
else if the button returned of the result is “Continue” then
– The below script is working fine.
tell application “Finder”
activate
choose file with prompt "Choose the date file "
set the_file to the result
try
duplicate the_file to folder “private:tmp” of startup disk with replacing
on error message
display dialog errorMessage
end try
set the_file to the result
set the name of the_file to “test.dat”
end tell
end if
end tell


Please guide me how to resolve this issue.

Thanks in advance…
-Rao

try this in place of open location target_URL

do shell script "curl " & target_URL & " > /private/tmp/test.dat"