Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Request problem
Wed, Mar 20 2013 3:20 PMPermanent Link

Uli Becker

I am trying to send a POST request to a php script:

  with GetRequest do
    URL := 'android_testpost.php';

  with PostRequest do
    method = rmPost;
    URL := 'android_testpost.php';
    RequestHeaders.Values['Content-Type'] := 'plain/text';


Whatever I tried: the script was able to read the GET-variable that I
sent with a GET-request, but not the POST-variable sent with a POST-request.

I wrote this simple php-code just to test that:

     if (count($_GET) > 0) {
       echo "Get-Variable found";
     } else  {
        echo "No Get-Variable found";
    if (count($_POST) > 0) {
      echo "Post-Variable found";
    } else  {
      echo "No Post-Variable found";

Funny: When I send a POST-request, the script tells me "Get-Variable
found", but it NEVER says "Post-Variable found".

Am I doing something wrong?

Wed, Mar 20 2013 4:32 PMPermanent Link


when you set the RequestContent instead of setting the Params


... you can get the postdata with:

$postdata = file_get_contents("php://input");

Greetings ... Peter
Sorry for my weird english
Thu, Mar 21 2013 3:22 AMPermanent Link

Uli Becker


thanks. Since I have never used a post request, I didn't realize that params are always get variables.

Sorry about the silly question.

Regards Uli