This documentation is archived and is not being maintained.

Sys.Net.WebRequest invoke Method

Visual Studio 2008

Executes a Web request.

Sys.Net.WebRequestManager.invoke(WebRequest);

Exception type

Condition

Sys.InvalidOperationException

invoke has been called more than one time.

If you have registered a completed request event handler for the Sys.Net.WebRequest instance, that handler is called asynchronously by the network stack as the request progresses. Calling invoke more than one time for the same WebRequest instance throws an exception if the executor has already issued the network request.

The following example uses the invoke method to execute a Web request. This code is part of a complete example found in the WebRequest class overview.

Show: