Gets or sets proxy information for the request.
Assembly: System (in System.dll)
is set to a null reference (Nothing in Visual Basic).
The caller does not have permission for the requested operation.
The property identifies the WebProxy object to use to process requests to Internet resources. To specify that no proxy should be used, set the property to the proxy instance returned by the GlobalProxySelection.GetEmptyWebProxy method.
The local computer or application config file may specify that a default proxy be used. If the property is specified, then the proxy settings from the property override the local computer or application config file and the HttpWebRequest instance will use the proxy settings specified. If no proxy is specified in a config file and the property is unspecified, the HttpWebRequest class uses the proxy settings inherited from Internet Explorer on the local computer. If there are no proxy settings in Internet Explorer, the request is sent directly to the server.
The HttpWebRequest class parses a proxy bypass list with wildcard characters inherited from Internet Explorer the same as the bypass list is parsed directly by Internet Explorer. For example, the HttpWebRequest class will parse a bypass list of "nt*" from Internet Explorer as a regular expression of "nt.*". So a URL of "http://nt.com" would bypass the proxy using the HttpWebRequest class and using Internet Explorer.
The HttpWebRequest class supports local proxy bypass. The class considers a destination to be local if any of the following conditions are met:
The destination contains a flat name (no dots in the URL).
The domain suffix of the destination matches the local computer's domain suffix (DomainName).
Changing the property after the request has been started by calling the GetRequestStream, BeginGetRequestStream, GetResponse, or BeginGetResponse method throws an InvalidOperationException. For information on the proxy element see <defaultProxy> Element (Network Settings).
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.