I’ve been following the tutorial over at http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api and have setup a Windows Azure account and deployed and everything’s working great.
But the lower section of that tutorial provides a way to get data from the API using jQuery/AJAX but I need to get data from the API from a Windows Metro App (C#).
I’ve been unable to find any tutorials or documentation for POST[ing] and GET[ing] data from a WebAPI from within a Metro style app.
Are there any tuts, or docs or samples or articles that you know of that may help?
Thank you!
From within a metro app, you can use the
HttpClientclass to call the methods on the Web API. There’s a good post at http://blogs.msdn.com/b/henrikn/archive/2012/02/16/httpclient-is-here.aspx about it, and this is a simple usage of it