AppleScript: Terminal – curl

(* These examples uses the curl command, see man pages for further details. *)

--GET Example
property PathToServer : "http://www.qusa.de"
set cmd to "curl -s " & quoted form of (PathToServer & "?com=show")
set ReturnValue to do shell script cmd

--POST Example
property PathToServer2 : "http://www.qusa.de"
set cmd2 to "curl  -s '" & quoted form of (PathToServer2 & "?id=59") & "' -d 'xy=51&name2=value2&press=ok'"
set ReturnValue2 to do shell script cmd2