i am trying to make a simple code for bigger project that depends on sending data to php website , but the result always empty, The Problem is both return empty result , i print the response to a label but it returns empty arrays,
Xamarin Code is
private async void sendphp()
{
Uri uri = new Uri("http://example.com/iservices/send.php");
var postData = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("param1", "value"),
new KeyValuePair<string, string>("param2", "value")
};
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, uri);
req.Content = new FormUrlEncodedContent(postData);
HttpClient client = new HttpClient();
var response = await client.SendAsync(req);
var content = await response.Content.ReadAsStringAsync();
lblInfo.Text = content;
}
PHP Code is :
<?php
print_r($_POST);
print_r($_FILES);
?>
The Problem is both return empty result , i print the response to a label but it returns empty arrays, i checked to server response it ok but the post is empty , why ??????? i spent 4 days trying many solution but all fails