I want to implement a request to receive and send to Windows Phone 8.1 using C #.
I must be able to read the text in the URL using the request for receipt, and I must send something in return so that it indicates your identifier with the text that I posted.
This is the code that I use for the mail request.
private async void Button_Click(object sender, RoutedEventArgs e) { Windows.Web.Http.HttpClient clientOb = new Windows.Web.Http.HttpClient(); Uri connectionUrl = new Uri("http://www.xyz.in/hoo/test.php/"); //text.Text = pairs; Dictionary<string, string> pairs = new Dictionary<string, string>(); pairs.Add("value1", "Hello"); pairs.Add("value2", "World!"); Windows.Web.Http.HttpFormUrlEncodedContent formContent = new Windows.Web.Http.HttpFormUrlEncodedContent(pairs); Windows.Web.Http.HttpResponseMessage response = await clientOb.PostAsync(connectionUrl, formContent); if (response.IsSuccessStatusCode) { var dialog = new MessageDialog(response.Content.ToString()); await dialog.ShowAsync(); } }
In the above code, it just returns the text on the website.
source share