Page 1 of 1
Does "post [variable] to URL" work from a revlet?
Posted: Mon Aug 13, 2012 7:57 pm
by Paul.RaulersonBUSIvAg
Writing first app in LiveCode and rather ambitiously, want it to run on Mac, Windows, iPad, and Web. Got the first three down, but the "
post myVariable to URL syntax seems to fail pretty miserably when ran as a Web application. It basically just gets back an unexpected (blank?) response and errors out.
Is there a special trick to doing that, or are we supposed to submit Ajax like commands in some other way?
Works perfectly well on Mac, Windows, and an Pad.
Yours,
-Paul
Here is a code example, I did have to block out the program name and the server, they normally have content in them but the server won't let me post anything with a URL or link in it.
Code: Select all
put ( "PGM=XXXX&OG=01&SCR=XX&lang=e&port=p&WUID=" & urlencode(field WUID) \
& "&WPWD=" & urlencode(field WPWD) \
& "&WPIN=" & urlencode(lPIN) ) \
into vRequest
post vRequest to URL
put it into vResponse
put urlDecode(vResponse) into vResponse
answer vResponse with "ok"
Re: Does "post [variable] to URL" work from a revlet?
Posted: Mon Aug 13, 2012 9:41 pm
by sturgis
In the standalone application settings for web did you put a check in the box for internet under security settings? This will cause a dialog to pop up asking the user to confirm that its ok for the revlet to access the internet.
Re: Does "post [variable] to URL" work from a revlet?
Posted: Mon Aug 13, 2012 10:29 pm
by Paul.RaulersonBUSIvAg
sturgis wrote:In the standalone application settings for web did you put a check in the box for internet under security settings? This will cause a dialog to pop up asking the user to confirm that its ok for the revlet to access the internet.
I did not see one for internet, but I did check and uncheck the one for network. I was thinking that having it checked meant it was disabled, but I probably read the docs wrong.
Thanks though!
-Paul
Re: Does "post [variable] to URL" work from a revlet?
Posted: Mon Aug 13, 2012 10:38 pm
by sturgis
DOh yep, its "network" that needs to be checked. Read what I mean not what I type! *grin*
Re: Does "post [variable] to URL" work from a revlet?
Posted: Mon Aug 13, 2012 11:54 pm
by Paul.RaulersonBUSIvAg
sturgis wrote:DOh yep, its "network" that needs to be checked. Read what I mean not what I type! *grin*
LOL!
Well, I was hoping that was the problem, and there was a setting stashed somewhere I missed.
Not happening though, has to be something I am doing (or not doing) I think, but whatever it is, it sure isn't very apparent.
Your,
Paul
Re: Does "post [variable] to URL" work from a revlet?
Posted: Tue Aug 14, 2012 5:05 am
by Paul.RaulersonBUSrLn
Okay, I found the culprit, but it isn't pretty.
The Web Revlet is not processing the SSL connections correctly for some reason. This is causing most of the problems, as it looks like LC never connects. The error only appears when you check "result" instead of "it". The exact error message, using the HTTPS address for Google (
Which I cannot type in here because I do not have permission to type in links or domain references. What is up with that?) is reproduced below:
Code: Select all
error -Error with certificate at depth: 1 issuer = /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority subject = /C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA err 20:unable to get local issuer certificate
It of course, works fine when you use http vice https.
This is a rather serious bug -
who can afford to send any kind of sensitive information over a clear connection?
This problem is most likely a showstopper if there is no plan to fix it. I hate that.
The other problem I found was the "ask password clear " command causes whatever the user enters to be inverted - when running from an Revlet. Like the above SSL issue, it works fine from a standalone or on a iPad/iPhone.
What is the proper way to get these annoying bugs addressed? Should I use one of the "Quick Response" tech support incidents or is there is a better way?
I am really digging LC, and really like how it gets out of the way and lets you work with getting an App out the door. Unfortunately, the need to support a bit of Web stuff is critical.
Help?
-Paul
Re: Does "post [variable] to URL" work from a revlet?
Posted: Tue Aug 14, 2012 10:29 am
by Klaus
Hi Paul,
I have been bitten by this before!
Add this line before every post/access to HTTPS connections:
...
libUrlSetSSLVerification false
post whatever to url "
https://wherever.com/mycgi"
...
Its not documented, but should do the trick.
Best
Klaus
Re: Does "post [variable] to URL" work from a revlet?
Posted: Tue Aug 14, 2012 3:58 pm
by Paul.RaulersonBUSIvAg
I would have sworn I posted a thank you- but it seems I did not. So...
Thank you Klaus! That worked and allowed me to move past an absolute showstopper.
I still want to follow up with it as a bug report, because it is a trifle nerve wracking depending upon an undocumented "feature" to make something actually work.
But thank you again!
Yours,
-Paul