WebOperationContext.OutgoingRequest Property


Gets the Web request context for the request being sent.

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

public OutgoingWebRequestContext OutgoingRequest { get; }

The following code shows how to set the method, content type and add a header to the outgoing request.

WebOperationContext.Current.OutgoingRequest.Headers.Add("Slug", "title");
WebOperationContext.Current.OutgoingRequest.Method = "GET";
WebOperationContext.Current.OutgoingRequest.ContentType = "application/octet-stream";

.NET Framework
Available since 3.5
Available since 4.0
Return to top