just starting to create an API to my a web application using the ASP.NET MVC4 Web API project template. http://www.asp.net/mvc/mvc4
No problems with the API so far, but I was about to write a small C# app to test the API.
Almost all the sample I can find is using the a class called HttpClient.
Where can I find the HttpClient and how do I install it?
Rather than using the build in HttpClient class of the .NET framework which has a lot of issues when dealing with StatusCodes that are different than the expected ones. I recommend using a library called RestSharp.
It has become .NET Http/Rest client of choice, you can get it here: http://restsharp.org/
It is a very powerful library that is perfectly suited to do what you want.
It's on nuget, search for HttpClient
http://nuget.org/packages/System.Net.Http
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