HttpMethod Constructor (String)

.NET Framework (current version)

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

Initializes a new instance of the HttpMethod class with a specific HTTP method.

Namespace:   System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

public HttpMethod(
	string method


Type: System.String

The HTTP method.

If an app needs a different value for the HTTP method from one of the static properties, the HttpMethod constructor initializes a new instance of the HttpMethod with an HTTP method that the app specifies.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top