Upraviť

Zdieľať cez


HttpMethod.Parse(ReadOnlySpan<Char>) Method

Definition

Parses the provided method into an HttpMethod instance.

public:
 static System::Net::Http::HttpMethod ^ Parse(ReadOnlySpan<char> method);
public static System.Net.Http.HttpMethod Parse (ReadOnlySpan<char> method);
static member Parse : ReadOnlySpan<char> -> System.Net.Http.HttpMethod
Public Shared Function Parse (method As ReadOnlySpan(Of Char)) As HttpMethod

Parameters

method
ReadOnlySpan<Char>

The method to parse.

Returns

An HttpMethod instance for the provided method.

Remarks

This method may return a singleton instance for known methods; for example, it may return Get if "GET" is specified. The parsing is performed in a case-insensitive manner, so it may also return Get if "get" is specified. For unknown methods, a new HttpMethod instance is returned, with the same validation being performed as by the HttpMethod(String) constructor.

Applies to