Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Http/Http.Abstractions/src/HttpMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public static class HttpMethods
/// </summary>
public static readonly string Put = "PUT";
/// <summary>
/// HTTP "QUERY" method.
/// </summary>
public static readonly string Query = "QUERY";
/// <summary>
/// HTTP "TRACE" method.
/// </summary>
public static readonly string Trace = "TRACE";
Expand Down Expand Up @@ -149,6 +153,18 @@ public static bool IsPut(string method)
return Equals(Put, method);
}

/// <summary>
/// Returns a value that indicates if the HTTP request method is QUERY.
/// </summary>
/// <param name="method">The HTTP request method.</param>
/// <returns>
/// <see langword="true" /> if the method is QUERY; otherwise, <see langword="false" />.
/// </returns>
public static bool IsQuery(string method)
{
return Equals(Query, method);
}

/// <summary>
/// Returns a value that indicates if the HTTP request method is TRACE.
/// </summary>
Expand All @@ -175,6 +191,7 @@ string _ when IsDelete(method) => Delete,
string _ when IsOptions(method) => Options,
string _ when IsHead(method) => Head,
string _ when IsPatch(method) => Patch,
string _ when IsQuery(method) => Query,
string _ when IsTrace(method) => Trace,
string _ when IsConnect(method) => Connect,
string _ => method
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Microsoft.AspNetCore.Http.Metadata.IDisableValidationMetadata
Microsoft.AspNetCore.Http.ProducesResponseTypeMetadata.Description.get -> string?
Microsoft.AspNetCore.Http.ProducesResponseTypeMetadata.Description.set -> void
Microsoft.AspNetCore.Http.Metadata.IProducesResponseTypeMetadata.Description.get -> string?
static Microsoft.AspNetCore.Http.HttpMethods.IsQuery(string! method) -> bool
static readonly Microsoft.AspNetCore.Http.HttpMethods.Query -> string!
1 change: 1 addition & 0 deletions src/Http/Http.Abstractions/test/HttpMethodslTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void CanonicalizedValue_Success()
(new string[] { "CONNECT", "Connect", "connect" }, HttpMethods.Connect),
(new string[] { "OPTIONS", "Options", "options" }, HttpMethods.Options),
(new string[] { "PATCH", "Patch", "patch" }, HttpMethods.Patch),
(new string[] { "QUERY", "Query", "query" }, HttpMethods.Query),
(new string[] { "TRACE", "Trace", "trace" }, HttpMethods.Trace)
};

Expand Down
Loading