Response GetRedirectedFrom Method C# API
Gets the Response from which this Response has been redirected.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.4.0.26 (1.0.0.0)
Syntax

public Response GetRedirectedFrom(
	int depth
)

Parameters

depth
Type: System Int32
How far to traverse up the redirect chain.

Field Value

The Response which this Response has been redirected from, or null if no redirection occurred.

Return Value

[Missing <returns> documentation for "M:Facilita.Web.Response.GetRedirectedFrom(System.Int32)"]

Remarks

If a request returns a redirect response code (e.g. 301 or 302), then eggPlant Performance will automatically follow the redirect, and the Response object returned from Send  will be the final destination (assuming FollowRedirects has been set to true). In this situation, this method can be used to examine the earlier responses in the redirect chain.

If the request was not redirected, then this method returns null.

Examples

The following example demonstrates finding where a Response was redirected from.
Request request1 = WebBrowser.CreateRequest(HttpMethod.GET, url1, 1);
Response response1 = request1.Send();

if (response1.WasRedirected)
{
    Response redirectedResponse = response1.GetRedirectedFrom(2);
    ...
}
See Also