WebOperationContext.IncomingRequest Property


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 request context for the request being received.

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

public IncomingWebRequestContext IncomingRequest { get; }

The following code shows how to use the IncomingRequest property to access the headers in the incoming HTTP request.

WebOperationContext current = WebOperationContext.Current;
WebHeaderCollection headers = current.IncomingRequest.Headers;

foreach (string name in headers)
    Console.WriteLine(name + " " + headers.Get(name));

.NET Framework
Available since 3.5
Return to top