HttpWebRequest

The HttpWebRequest class is interesting in that until very recently, it was the workhorse class of network programming in .NET. This is evident in the huge explosion of the class specification when compared to the relative simplicity of the WebRequest class. There are properties for each standard HTTP header that could be defined for a given payload, as well as a headers property inherited from the base class for specifying custom or non-standard headers. There are properties to specify the transport details, such as the TransferEncoding, or whether or not to send data in chunked segments. There are properties to specify how to handle exceptional behaviors from the remote host, such as the MaximumResponseHeadersLength and ...

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.