I am attempting to access RESTful web services. As suggested in prior postings I am investigating cURL via "open process" due to security concerns I can only address the process via stdin and stdout (passwords/data on the command line would be visible by other users). So, I am currently using “open process” and passing a command line that causes cURL to prompt for the users password (--user “user” since no password is specified it will prompt). “Runtime Revolution”/”LiveCode” or whatever they are calling it this week does not see any of the output when I invoke “read from process” (at least until the process has ended). Any assistance would be appreciated a HTTP library that actually works according to the asynchronous model of “Runtime Revolution”/”Live Code” would also be appreciated.
Any suggestions?
Kevin
RESTful Applications
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: RESTful Applications
Kevin,
Post your script.
Watch this.
Oh... and you may be unable to read and write to the process to enter the password. You may have to echo and pipe it, like
Kind regards,
Mark
Post your script.
Watch this.
Oh... and you may be unable to read and write to the process to enter the password. You may have to echo and pipe it, like
Code: Select all
echo $pw | sudo something
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: RESTful Applications
Visited a posting with a similar suggestion had success with *nix systems unfortunately not with Windoze.
Re: RESTful Applications
It also has issues with security and other users capable of viewing the command line for processes.
Re: RESTful Applications
Sorry, allow me to elaborate even using this syntax above results in security related information being read by Top or Task Mangler. As another developer stated what is the point of in flight encryption and etc, when the password, user, ... are in plain site. Like I previously said I would prefer a pure transcript solution. I currently utilize a completely asynchronous pure transcript STOMP library I created unfortunately some of those utilizing the workbench are behind firewalls which interfere with the library. The message broker I am using also support RESTful and cURL support all forms of authentication and proxies so it would be a easy move if I could actually communicate with it via stdin and stdout.
Re: RESTful Applications
Test code Windoze...
on mouseUp
local _rpc
local _cmd
put "C:\_KJW\CURL\CURL.EXE" & space & "--user" & space & QQ("root") & space & "--url" & space & QQ("http://localhost:8080/Absinthe") into _cmd
kill 9 process _cmd
put XMLRPC_Invoke("_ListMethods") into _rpc
open process _cmd for binary update
encode _cmd
send "TListMethods" & space & QQ(_cmd) to me in 1 millisecond
end mouseup
on TListMethods aApplication, aMessage
decode aApplication
decode aMessage
local _processes
put openProcesses() into _processes
if aApplication is not among the lines of _processes then
exit TListMethods
end if
read from process aApplication until ":" in 50 milliseconds
if empty is not it then
put it after aMessage
end if
if aMessage contains ":" then
write numToChar(13) & numToChar(10) to process aApplication
else
encode aApplication
encode aMessage
send "TListMethods" & space & aApplication & comma & aMessage to me in 50 milliseconds
end if
end TListMethods
on mouseUp
local _rpc
local _cmd
put "C:\_KJW\CURL\CURL.EXE" & space & "--user" & space & QQ("root") & space & "--url" & space & QQ("http://localhost:8080/Absinthe") into _cmd
kill 9 process _cmd
put XMLRPC_Invoke("_ListMethods") into _rpc
open process _cmd for binary update
encode _cmd
send "TListMethods" & space & QQ(_cmd) to me in 1 millisecond
end mouseup
on TListMethods aApplication, aMessage
decode aApplication
decode aMessage
local _processes
put openProcesses() into _processes
if aApplication is not among the lines of _processes then
exit TListMethods
end if
read from process aApplication until ":" in 50 milliseconds
if empty is not it then
put it after aMessage
end if
if aMessage contains ":" then
write numToChar(13) & numToChar(10) to process aApplication
else
encode aApplication
encode aMessage
send "TListMethods" & space & aApplication & comma & aMessage to me in 50 milliseconds
end if
end TListMethods