Permalink
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (75 sloc) 3.33 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
<webRequestModules> Element (Network Settings)
03/30/2017
.net-framework
dotnet-clr
article
VB
CSharp
C++
jsharp
webRequestModules element
<webRequestModules> element
1263de11-3e0a-4f94-97c9-710b2ae53817
14
mcleblanc
markl
markl

<webRequestModules> Element (Network Settings)

Specifies modules to use to request information from network hosts.

<configuration>
<system.net>
<webRequestModules>

Syntax

      <webRequestModules>   
</webRequestModules>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Element Description
add Adds a custom Web request module to the application.
clear Removes all registered Web request modules from the application.
remove Removes a custom Web request module from the application.

Parent Elements

Element Description
system.net Contains settings that specify how the .NET Framework connects to the network.

Remarks

The webRequestModules element registers descendants of the xref:System.Net.WebRequest class to handle information requests to network hosts. Web request modules must implement the xref:System.Net.IWebRequestCreate interface.

The .NET Framework includes Web request modules for URIs that begin with http://, https://, and file://. You can override the default modules only by registering a custom module in the configuration file.

Configuration Files

This element can be used in the application configuration file or the machine configuration file (Machine.config).

Example

The following example registers the default HTTP module. You should replace the values for Version and PublicKeyToken with the correct values for the specified module.

<configuration>  
  <system.net>  
    <webRequestModules>  
      <add prefix="http"  
           type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0,  
           Culture=neutral, PublicKeyToken=b77a5c561934e089"  
      />  
    </webRequestModules>  
  </system.net>  
</configuration>  

See Also

xref:System.Net.WebRequest
xref:System.Net.IWebRequestCreate
Network Settings Schema