<clear> Element for <webRequestModules>

Clears registered Web request modules.

<configuration>
   <system.net>
      <webRequestModules>
         <clear>

<clear/>

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.

Example

The following example clears all Web request modules and then registers a custom Web request module for HTTP.

<configuration>
   <system.net>
      <webRequestModules>
         <clear/>
         <add prefix="http" type="MyHttpModule.dll, MyHttpModule" />
      </webRequestModules>
   </system.net>
</configuration>

Configuration File

This element can be used in the application configuration file, the machine configuration file (Machine.config), and the publisher policy file.

See Also

WebRequest | webRequestModules Element | Network Settings Schema