Sys.Net.WebRequestManager.executeRequest Method

Sends Web requests to the default network executor.

Note

This member supports the client-script infrastructure and is not intended to be used directly from your code.

Sys.Net.WebRequestManager.executeRequest(WebRequest);

Parameters

Parameter

Description

WebRequest

An instance of the Sys.Net.WebRequest class.

Remarks

The executeRequest method sends Web requests to the default executor. To execute a Web request, you must call the invoke method.

The WebRequestManager class performs the following tasks when passing control to a network executor:

  • If the request does not already have an executor, it creates an instance of the default network executor class and sets the executor instance of the request object.

  • Associates the current WebRequest instance with the default executor instance. This enables the executor to access the relevant request information from the WebRequest instance so that the executor can create a network request.

  • Adds a referrer property to the header collection and sets it to the value of the document URL.

  • Before it sends the request to the network executor, raises the cancellable add_invokingRequest event.

  • If the event arguments indicate that the call was canceled, immediately returns from the current method call. In that case, the handler specified by the add_completedRequest method is never called.

  • Reroutes the completion event to the WebRequest instance to make sure that the add_completedRequest event handler is called. This occurs after the method specified by the add_invokingRequest returns, and only if you have registered the add_completedRequest method.

  • Passes control to the default Web request executor.

Example

The following example shows how to execute a Web request. This code is part of a complete example found in the WebRequestManager class overview.

Sys.Net.WebRequestManager.executeRequest(wRequest);

See Also

Reference

Sys.Net.WebRequestManager Class

Sys.Net.WebRequestExecutor Class

Sys.Net.XMLHttpExecutor Class