Repository navigation
Conversation
Implements the four approved QueryAsync overloads on HttpClient following the approved API proposal for RFC 10008 QUERY method support: - Task<HttpResponseMessage> QueryAsync(string?, HttpContent?) - Task<HttpResponseMessage> QueryAsync(string?, HttpContent?, CancellationToken) - Task<HttpResponseMessage> QueryAsync(Uri?, HttpContent?) - Task<HttpResponseMessage> QueryAsync(Uri?, HttpContent?, CancellationToken) Also updates the reference assembly and adds unit tests verifying method invocation, request headers/content preservation, cancellation, and ObjectDisposedException behavior. Fixes dotnet#113522
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
ManickaP
approved these changes
Nov 3, 2026
MihaZupan
reviewed
Nov 3, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the addition of the HttpClient.QueryAsync overloads.
No open issues 🎉
What changed in this PR
Adds four HttpClient.QueryAsync overloads for HTTP QUERY requests, matching the existing body-bearing request helpers and the API shape in #113522.
Changes:
- Implements string and
Urioverloads, with optional cancellation tokens, usingHttpMethod.Query. - Adds matching declarations to the reference assembly.
- Adds tests for overload behavior, request content and URI preservation, cancellation, and disposed clients.
| File | Description |
|---|---|
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs |
Adds QUERY success, cancellation, and disposal tests. |
src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs |
Implements and documents the four QueryAsync overloads. |
src/libraries/System.Net.Http/ref/System.Net.Http.cs |
Exposes the overloads in the public reference API. |
Review effort: Balanced
MihaZupan
approved these changes
Nov 14, 2026
Apply review suggestion to align the QueryAsync XML documentation with the other HttpClient request helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
MihaZupan
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #113522
Summary
This PR implements the approved API proposal for adding QueryAsync overloads to HttpClient to support the RFC 10008 HTTP QUERY method:
Changes
Validation