Need help : http.request POST [SOLVED]

Hello !

I try, try and retry but i can’t send nothing in my http.request POST… ='(

What i’v try :


http.request("http://webperso.iut.univ-paris8.fr/~ldavid/Codea/ProjectSharing/", function(data)
     print(data)
end, alert, {
     method = "POST",
     data = "test"
     -- data = "test=test"
     -- data = 'test="test"'
     -- data = {test="test"}
     -- data = {["test"]="test"}
     -- data = '{["test"]="test"}'
     -- and same with json.encode
})

and this is the web page :


<?php
	echo "GET\
";
	var_dump($_GET);
	echo "\
POST\
";
	var_dump($_POST);
?>

Thanks before !

Excuse me, i discovered about the global var $_REQUEST.

Could you go a bit more in the details? That could be useful for us. Thanks.

@Jmv38
Excuse me, i’ve believe that i found the solution but I was wrong…

I would just post some data with http.request and that doesn’t work…
I don’t receive what i send in the global var $_POST in php…

Ok, i’v understand why… In fact, when codea make an http.request with method=“POST”, the data are not send in $_POST but in $HTTP_RAW_POST_DATA.

Thank you for finding out and posting back. I could not get the PHP receiving end working until I found this post.