WebOperationContext.IncomingResponse Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the Web response context for the request being received.

Namespace:   System.ServiceModel.Web
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

public IncomingWebResponseContext IncomingResponse { get; }

The following code shows how to get the content length, content type, and status code from the IncomingResponse property.

WebOperationContext current = WebOperationContext.Current;
Console.WriteLine("Incoming Response");
Console.WriteLine("ContentLength: " + current.IncomingResponse.ContentLength);
Console.WriteLine("ContentType: " + current.IncomingResponse.ContentType);
Console.WriteLine("StatusCode: " + current.IncomingResponse.StatusCode);

.NET Framework
Available since 3.5
Silverlight
Available since 4.0
Return to top
Show: