You have three different choices for consuming RESTful APIs when working in the .NET Framework.

These include: HttpWebRequest, WebClient and HttpClient. Note that this post would discuss the ways we can access RESTful APIs from within the managed environment, i.e., without resorting to third party libraries.
In the sections that follow we will explore each of these three approaches with relevant code examples in each approach to understand the concepts better.Let’s start our discussion with the WebRequest abstract class.System.Net.WebRequestThe System.Net.WebRequest class is an abstract class – you would need to create a HttpWebRequest or FileWebRequest to consume Http requests using this class.

The following code snippet shows how you can work with WebRequest.To read this article in full or to leave a comment, please click here

Leave a Reply