RESTful Applications

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

RESTful Applications

Post by Kevin » Fri Jun 24, 2011 5:24 pm

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: RESTful Applications

Post by Mark » Fri Jun 24, 2011 11:54 pm

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

Code: Select all

echo $pw | sudo something
Kind regards,

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

Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

Re: RESTful Applications

Post by Kevin » Sat Jun 25, 2011 3:44 am

Visited a posting with a similar suggestion had success with *nix systems unfortunately not with Windoze.

Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

Re: RESTful Applications

Post by Kevin » Sat Jun 25, 2011 3:46 am

It also has issues with security and other users capable of viewing the command line for processes.

Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

Re: RESTful Applications

Post by Kevin » Sat Jun 25, 2011 3:57 am

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.

Kevin
Posts: 74
Joined: Fri Oct 02, 2009 3:47 pm

Re: RESTful Applications

Post by Kevin » Sat Jun 25, 2011 4:38 am

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

Post Reply

Return to “Internet”