One class to rule them all – the WebRequest abstract class

As any software craftsman will tell you, if you want to understand how to leverage a library or toolset provided to you by another developer, just look at the public interface. If the interface is designed well enough, it will be obvious as to how that tool should be used. A good interface design communicates a lot about the limits and original intentions for the use of a piece of library software, and that's what we'll be looking at in this section. The WebRequest abstract class of the System.Net namespace is the public interface for creating and working with general-purpose network requests that are meant to be sent over the internet.

Get Hands-On Network Programming with C# and .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.