Export (0) Print
Expand All

IXMLHTTPRequest2Callback::OnRedirect method

Occurs when a client sends an HTTP request that the server redirects to a new URL.

Syntax


HRESULT OnRedirect(
  [in, optional]  IXMLHTTPRequest2 *pXHR,
  [in]            const WCHAR *pwszRedirectUrl
);

Parameters

pXHR [in, optional]

The HTTP request object being redirected.

pwszRedirectUrl [in]

The new URL for the HTTP request.

Return value

Returns S_OK on success.

Note  This callback function must not throw exceptions.

Remarks

If the request redirection is not permitted, you can call the Abort method on the pXHR object.

XMLHTTPRequest2 imposes a maximum of 100 re-directions on any request. Any re-directions above that limit generate an OnError event. Applications have no access to the headers for re-directions.

Once the final redirection has completed and the final URL has been reached, the application receives an OnHeadersAvailable callback.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Version

MSXML 6.0 and later

Header

Msxml6.h

IDL

Msxml6.idl

See also

Abort Method
OnError Event
OnHeadersAvailable Event
IXMLHTTPRequest2Callback

 

 

Community Additions

ADD
Show:
© 2014 Microsoft