This documentation is archived and is not being maintained.

<add> Element for webRequestModules (Network Settings)

Adds a custom Web request module to the application.

<configuration> Element
  <> Element (Network Settings)
    <webRequestModules> Element (Network Settings)
      <add> Element for webRequestModules (Network Settings)
  prefix = "URI prefix" 
  type = "module name, Version, Culture, PublicKeyToken" 

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





The URI prefix for requests handled by this Web request module.


The assembly and class name of the module that implements this Web request module.

Child Elements


Parent Elements




Specifies modules to use to request information from network hosts.

The prefix attribute defines the URI prefix that uses the specified Web request module. Web request modules are typically registered to handle a specific protocol, such as HTTP or FTP, but can be registered to handle a request to a specific server or path on a server.

The Web request module is created when a URI matching prefix is passed to the WebRequest.Create method.

The value for the prefix attribute should be the leading characters of a valid UR --for example, "http", or "".

The value for the type attribute should be a valid DLL name and corresponding class name, separated by a comma .

Configuration Files

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

The following code example registers a custom Web request module for HTTP. You should replace the values for Version and PublicKeyToken with the correct values for the specified module.

      <add prefix="http"
           type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0,
           Culture=neutral, PublicKeyToken=b77a5c561934e089"