I’m learning how to build C#/XAML metro apps in Windows 8 and I was wondering if there’s a way to call RESTful services using the framework? I was able to with a JS/HTML5 app, but I am wanting to do this from C#/XAML.
Any help is appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to use System.Net.HttpClient and HttpRequestMessage.
Here’s a writeup for Consuming Json Data in WinRT
Basically, it’s used like:
If you need to modify the request or get called during the pipeline of execution (add things like headers) you can use HttpMessageHandler.
Here’s another related post asking about headers with WinRT:
Using HttpRequestHeaders in WinRT & C#