HttpRequestMessageProperty.Method Property

Gets or sets the HTTP verb for the HTTP request.

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

public string Method { get; set; }

Property Value

Type: System.String
The HTTP verb for the HTTP request.

ExceptionCondition
ArgumentNullException

The value is set to null.

By default, WCF uses the POST verb for HTTP messages. The GET verb is used by WCF to display help information when accessing a ServiceHost's base address. This is useful for checking whether a WCF service is active when using a Web browser. Other methods defined by the HTTP RFC are PUT, DELETE, HEAD, OPTIONS, TRACE, and CONNECT. These methods have special behaviors when interoperating with other services.

The following code gets an instance of this class from the message and then dispatches to different methods based on this property.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

.NET Compact Framework

Supported in: 3.5
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft