The portable Web API client library
September 25, 2015 Leave a comment
I this short post I just would like to draw your attention to a portable Web API client library available from NuGet. You can use it in multiple project types, like console and Window Phone apps where you need to perform HTTP-related actions.
The library is available from within Visual Studio in the NuGet package manager:
From then on you can use the HttpClient object from the System.Net.Http namespace to initiate HTTP calls, e.g.:
HttpClient client = new HttpClient() { BaseAddress = new Uri("http://www.myapi.com/") }; HttpResponseMessage response = await client.GetAsync("customers");