Microsoft Silverlight will reach end of support after October 2021. Learn more.
Registers a WebRequest descendant for the specified URI.
Assembly: System.Net (in System.Net.dll)
'Declaration Public Shared Function RegisterPrefix ( _ prefix As String, _ creator As IWebRequestCreate _ ) As Boolean
public static bool RegisterPrefix( string prefix, IWebRequestCreate creator )
true if registration is successful; otherwise, false.
The RegisterPrefix method registers WebRequest descendants to service requests. WebRequest descendants are typically registered to handle a specific protocol, such HTTP or HTTPS, but can be registered to handle a request to a specific server or path on a server.
Duplicate prefixes are not allowed. RegisterPrefix returns false if an attempt is made to register a duplicate prefix.
The RegisterPrefix method allows an application to configure which derived WebRequest type will be instantiated when making a request to a specific URI. WebRequest creators are typically registered to handle a specific protocol, such HTTP or HTTPS, but can be registered to handle a request to a specific server or path on a server. This method is useful when more than one derived WebRequest type can process requests for the same protocol. The Silverlight 3 and later runtime supports multiple HTTP handlers each having different capabilities. The RegisterPrefix method is a convenient way to indicate which handler to use depending on the target of the request and the capabilities it requires. For example, a web service that uses Representational State Transfer (REST) might require the WebRequestCreator.ClientHttp handler while a SOAP web service might be able to use the default WebRequestCreator.BrowserHttp handler.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Supported in: Windows Phone OS 7.0
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.