<clear> Element for webRequestModules (Network Settings)
Removes all registered Web request modules from the application.
<configuration>
<system.net>
<webRequestModules>
<clear>
Syntax
<clear/>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
None.
Child Elements
None.
Parent Elements
Element | Description |
---|---|
webRequestModules | Specifies modules to use to request information from network hosts. |
Remarks
The clear
element removes all registered Web request modules that were defined earlier in the configuration file or at a higher level in the configuration hierarchy.
Configuration Files
This element can be used in the application configuration file or the machine configuration file (Machine.config).
Example
The following example clears all Web request modules and then registers a Web request module for HTTP.
<configuration>
<system.net>
<webRequestModules>
<clear/>
<add prefix="http"
type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</webRequestModules>
</system.net>
</configuration>
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.