hello! i been trying to experiment with httplib. i been trying to run the HTTP post example example from here:
i have the php file in my server and sometimes when i run the .py script on the phone nothing happens. sometimes im getting an error from line 12:
conn.request("POST","/kplex.net/exampleforlder/example.php", params, headers). and sometimes it ask me for the access point 2 times and then get the same error... and sometimes it writes an empty file!
Do anybody know what is going on?
i dont know php, but i asked to a friend and he told me i need to access $get of $post and make the data variable. is this true?
he make this code, but it tried it and it doesnt work neither
// this php script takes in the parameter data and writes it into the text file called texfile.txt
$filename = 'textfile.txt';
if ($_SERVER['REQUEST_METHOD') == "POST")
$data = $_POST['data'];
$data = $_GET['data'];
file_put_contents($filename, $data . "\n");
echo 'data received OK';