INFO: Migrating from .NET HttpWebRequest to Rebex HttpRequest
In many cases, upgrading from .NET's
System.Net.HttpWebRequest to Rebex
straightforward. However, please be aware that for various reasons,
it is not a one-to-one replacement. This article discusses common pitfalls.
HttpRequest does not inherit from HttpWebRequest
System.Net.HttpWebRequest and Rebex
HttpRequest inherit from
In an ideal world, we would inherit
HttpWebRequest to ensure a smooth migration.
Unfortunately, this is not possible because
HttpWebRequest lacked a suitable constructor on legacy platforms (.NET 4.0 and earlier).
This could pose a problem when using Rebex HTTPS within an application or with a library that has been designed to only use
and assume that
WebRequest.Create will always return an instance of this object.
The recommended workaround is to modify existing application or library code
HttpRequest instead of
HttpRequest does not use ServicePointManager
HttpRequest does not utilize
To implement a custom server certificate validation routine, use
custom certificate validation event.
HttpRequest uses a different proxy API
HttpRequest does not support the
Proxy property and does not utilize system's default proxy.
If you intend to connect via a proxy, use
HttpRequest does not establish connection automatically by default
On .NET Compact Framework, .NET's
HttpWebRequest class attempts to establish an Internet connection when a network is not accessible.
HttpRequest does not do this by default. To enable equivalent behavior, set
HttpRequest lacks cookies API
At the moment,
CookieContainer property. We will add this soon.
Until then, cookies must be accessed via custom code through