I have tried posting to the server using the following code:
C#:
myButton.Click += delegate
{
var url = "https://www.myurl.com/test.php";
var client = new RestClient(url);
var request = new RestRequest(Method.POST);
request.AddParameter("A", "foo");
request.AddParameter("B", "bar");
var response = client.Execute(request);
textView.Text = response.Content;
}
PHP:
<?php
die('aaa'.$_POST['A'].$_POST['B']);
?>
The textView
is being set to 'aaa', so it's receiving data from the server. The problem is the $_POST
data is not being sent with request.AddParameter
. I have also tried with var client = new RestClient("Resource", url);
. That doesn't work either. Maybe "Resource"
is incorrect.