HttpMethod.Parse(ReadOnlySpan<Char>) Method

Definition

Parses the provided method into an HttpMethod instance.

C#
public static System.Net.Http.HttpMethod Parse(ReadOnlySpan<char> method);

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

Produkt Verzie
.NET 8, 9, 10