Skip to content

add HttpMethod.Query #115934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 26, 2025
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
1 change: 1 addition & 0 deletions src/libraries/System.Net.Http/ref/System.Net.Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ public HttpMethod(string method) { }
public static System.Net.Http.HttpMethod Patch { get { throw null; } }
public static System.Net.Http.HttpMethod Post { get { throw null; } }
public static System.Net.Http.HttpMethod Put { get { throw null; } }
public static System.Net.Http.HttpMethod Query { get { throw null; } }
public static System.Net.Http.HttpMethod Trace { get { throw null; } }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Net.Http.HttpMethod? other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public partial class HttpMethod : IEquatable<HttpMethod>
public static HttpMethod Trace { get; } = new("TRACE", http3StaticTableIndex: -1);
public static HttpMethod Patch { get; } = new("PATCH", http3StaticTableIndex: -1);

/// <summary>Gets the HTTP QUERY protocol method.</summary>
/// <value>The HTTP QUERY method.</value>
public static HttpMethod Query { get; } = new("QUERY", http3StaticTableIndex: -1);

/// <summary>Gets the HTTP CONNECT protocol method.</summary>
/// <value>The HTTP CONNECT method.</value>
public static HttpMethod Connect { get; } = new("CONNECT", H3StaticTable.MethodConnect);
Expand Down Expand Up @@ -106,6 +110,7 @@ public static HttpMethod Parse(ReadOnlySpan<char> method) =>
4 => Post,
_ => Patch,
},
'q' => Query,
't' => Trace,
_ => null,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void StaticProperties_VerifyValues_PropertyNameMatchesHttpMethodName()
Assert.Equal("HEAD", HttpMethod.Head.Method);
Assert.Equal("OPTIONS", HttpMethod.Options.Method);
Assert.Equal("TRACE", HttpMethod.Trace.Method);
Assert.Equal("QUERY", HttpMethod.Query.Method);
}

[Fact]
Expand Down Expand Up @@ -160,6 +161,7 @@ public static IEnumerable<object[]> Parse_UsesKnownInstances_MemberData()
yield return new object[] { HttpMethod.Patch, nameof(HttpMethod.Patch) };
yield return new object[] { HttpMethod.Post, nameof(HttpMethod.Post) };
yield return new object[] { HttpMethod.Put, nameof(HttpMethod.Put) };
yield return new object[] { HttpMethod.Query, nameof(HttpMethod.Query) };
yield return new object[] { HttpMethod.Trace, nameof(HttpMethod.Trace) };
}

Expand Down
Loading