Any samples on consuming rest service post method in windows 8 apps.Please let me know the possible links on that.
Try this
using System.IO;
using System.Net.Http;
using System.Text;
var objHttpClient = new HttpClient();
var formParameters = "<details><id>1</id><name>test</name></details>");
var objHttpRequestMessage = new HttpRequestMessage(HttpMethod.Post, "http://example.com/page");
objHttpRequestMessage.Content = new StreamContent(new MemoryStream(Encoding.UTF8.GetBytes(formParameters)));
objHttpRequestMessage.Content.Headers.Add("Content-Type", "text/xml");
var result = await objHttpClient.SendAsync(objHttpRequestMessage);
Also check HttpClient sample on MSDN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With