LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
nimbleRev
- Posts: 10
- Joined: Mon Mar 09, 2009 9:50 pm
Post
by nimbleRev » Thu Mar 19, 2009 12:53 am
been stumbling with this all day. GET is working PUT is working but POST doesn't even hit the server.
Code: Select all
put "testing" into noteMsg
put libUrlFormData("note", noteMsg) into postVars
post postVars to URL "http://mydomain.com/index.php?c=controller&a=action"
put it into jsonResult
"it" ends up with what appears to be a result from a previous call to the URL library. I tailed both the webserver logs and the application logs and it works fine for GET and PUT but the logs show nothing when using the post command.
Any ideas? I'm on a Intel MacBook Pro running OS X 10.5.6. I'm using the trial version of Revolution Studio V3.0 Build 750. The url I'm posting to is running on a Parallels virtual machine on the same macbook running Revolution.
-
Mark Smith
- Posts: 179
- Joined: Sat Apr 08, 2006 11:08 pm
-
Contact:
Post
by Mark Smith » Thu Mar 19, 2009 4:06 am
Have you tried including all the parameters in the post data?
I mean the 'c=controller&a=action'
I wouldn't swear to it, but I can't remember ever trying to pass a query string in a post url. I've never had any problem using POST with libUrl.
Best,
Mark
-
nimbleRev
- Posts: 10
- Joined: Mon Mar 09, 2009 9:50 pm
Post
by nimbleRev » Thu Mar 19, 2009 8:27 am
gave it a shot without the query string in the url, no dice. still not hitting the server (at least not being logged by the web server). also tried it on another laptop, virtual machine setup and got the same result. hmm.....
-
Mark
- Livecode Opensource Backer

- Posts: 5150
- Joined: Thu Feb 23, 2006 9:24 pm
-
Contact:
Post
by Mark » Thu Mar 19, 2009 8:53 am
Hi,
As far as I know, it is impossible to use POST and GET mixed together, i.e. you can't put any parameters in a URL while using POST.
Are you sure that the server can handle POST? Often, e.g. in PHP scripts, you need to change the server to handle a different type of request. GET uses the GET method on the server, while POST uses stdin.
Best,
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
-
Philhold
- Posts: 64
- Joined: Thu Mar 05, 2009 3:39 pm
Post
by Philhold » Thu Mar 19, 2009 12:00 pm
I'd be tempted to put a simple PHP test form using POST on the server with a PHP script that just prints the result to your browser. Just to check the server end. If that works then you can rule it out and dig deeper in your RunRev app.
Cheers
Phil
-
nimbleRev
- Posts: 10
- Joined: Mon Mar 09, 2009 9:50 pm
Post
by nimbleRev » Thu Mar 19, 2009 7:00 pm
just wanted to thank everyone for chiming in on this.
here's what I did this morning. i created a simple html file on my server called "form.html" with a basic html form containing one input field. first i posted it to "index.php". it worked fine, and the post request showed up in the lighttpd server log and in my application's log as a post request with right form field name and value.
then i tried the same thing with "index.php?c=controller&a=action" again it worked perfectly, the request reached my controller action (front controller is only looking for GET params at the moment, although i could change that). Both the GET and POST parameters showed up in the application log and the server log recorded the post request.
when I try doing this in Rev the POST request doesn't even show up in the server logs. The exact same request with GET and PUT works fine.
Code: Select all
post "msg=hello" to URL "http://mylocaldomain-dev.com/index.php"
I would just assume use PUT and move on but I need my Rev code to capture a result from the server and as far as I can tell there is no way to do that when using PUT with a URL...
-
nimbleRev
- Posts: 10
- Joined: Mon Mar 09, 2009 9:50 pm
Post
by nimbleRev » Fri Mar 20, 2009 12:34 am
tried another experiment. I took a simple php file completely outside of my application. all this file does is log GET, POST and PUT information to a local file.
Code: Select all
$handle = fopen('app.log', 'a');
parse_str(file_get_contents("php://input"), $put_vars);
fwrite($handle, "Request Info: ".json_encode($_SERVER)."\n");
fwrite($handle, "GET Vars: ".json_encode($_GET)."\n");
fwrite($handle, "POST Vars: ".json_encode($_POST)."\n");
fwrite($handle, "PUT Vars: ".json_encode($put_vars)."\n");
fwrite($handle, "<--------- End Request ---------->\n");
fclose($handle);
tried posting to this file running on two separate servers, one was a local virtual machine running lighttpd and one was a remote server running apache. in both cases GET and PUT works but POST does nothing.
at this point I can only conclude that the POST functionality of RunRev is broken (at least in my two installations).
-
Janschenkel
- VIP Livecode Opensource Backer

- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
-
Contact:
Post
by Janschenkel » Fri Mar 20, 2009 7:46 am
Have you tried to glean more information from the
result or
it local variables, or used the
libUrlSetLogField command to help you figure out what's going on?
Code: Select all
on mouseUp
libUrlSetLogField the long id of field "Log"
put "testing" into noteMsg
put libUrlFormData("note", noteMsg) into postVars
post postVars to URL "http://mydomain.com/index.php?c=controller&a=action"
answer "the result:" && the result & return & "it:" && it
end mouseUp
I hope this helps clear up the problem,
Jan Schenkel.
-
nimbleRev
- Posts: 10
- Joined: Mon Mar 09, 2009 9:50 pm
Post
by nimbleRev » Fri Mar 20, 2009 8:09 pm
finally solved it (whew)!
turns out ListMagic is the culprit here. i created a brand new stack with only the code I was using to do the post and it worked. then I slowly added back the components from my previous stack until it stopped working.
as soon as either of these ListMagic functions are called, the post command no longer works.
Code: Select all
put LMGetCheckedBoxes() into checkedRowsList
put LMExtractLines(checkedRowsList) into selectedTestersList
no idea why those cause this problem, but as soon as I comment them out it works.
i'm ditching listmagic for now, going to start using the new grid control and re-created the functionality i needed with that.
hope this saves someone else some serious time!