Posted 10 March 2015 - 08:04 AM
I am creating a HTTP program that contacts my webserver and saves the posted data to a file. The two post names I am using are "author" and "message" these are the same for both the program and the server. For examples sake, I am just creating a mock up PHP script due to the nature of the script and I have eliminated any other factors that could lead to problems.
post.php:
program.lua:
Program.lua should print "test: tset", however it just returns nil. I am using noip.com as I have a dynamic ip address, thought I should mention it, just in case it is effecting the functionality.
post.php:
<?php
$current = $_POST["author"] . ": " . $_POST["message"];
echo $current;
?>
program.lua:
local handle = http.post("http://cdel.ddns.net/chirp/post.php", "author=test&message=tset")
print(handle.readAll())
Program.lua should print "test: tset", however it just returns nil. I am using noip.com as I have a dynamic ip address, thought I should mention it, just in case it is effecting the functionality.