Skip to content

Add QueryAsync support for the HTTP QUERY (RFC 10008) - #62

Merged
scottoffen merged 2 commits into
mainfrom
add-query
Aug 5, 2026
Merged

Add QueryAsync support for the HTTP QUERY (RFC 10008)#62
scottoffen merged 2 commits into
mainfrom
add-query

Conversation

@scottoffen

Copy link
Copy Markdown
Owner

Summary

  • Added a dedicated QueryAsync extension method family on HttpRequestBuilder, mirroring GetAsync/PostAsync/etc. with the same four overloads (no-args, CancellationToken, HttpCompletionOption, and both), for the HTTP QUERY method defined in RFC 10008. Uses HttpMethod.Query on .NET 10+ and falls back to a custom HttpMethod on earlier multi-targeted frameworks.
  • Fixed FluentJsonSerializer.DefaultJsonSerializerOptions gating DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull behind #if NETSTANDARD2_1_OR_GREATER, a symbol that is only defined for the literal netstandard2.1 TFM and not for net6.0 and later. This caused null-valued properties to be serialized as "property":null instead of omitted on net6.0 through net10.0, inconsistent with the netstandard2.1 build. Changed the gate to #if !NETSTANDARD2_0, which covers netstandard2.1 and every net6.0+ TFM, including future ones added to the multi-target list.
  • Added QueryAsyncTests, covering all four QueryAsync overloads and asserting the request method is HttpMethod.Query.
  • Updated the root README and package README with a note describing the QueryAsync addition
  • Updated docs/docs/sending-requests.md with the a QUERY section and example, and added a row to the Quick Reference table.
  • Added the same QueryAsync note to docs/docs/index.md

Related issue

Fixes #61 (null properties serialized instead of omitted on net6.0+, reported against 5.0.3)

Type

  • Bug fix
  • Feature
  • Docs
  • Other: ___

Checklist

  • Descriptive title and clear description
  • Tests added/updated (xUnit + Shouldly + Moq if needed)
  • Docs updated (if user-facing behavior changed)
  • No cosmetic/whitespace-only changes
  • Follows the contribution guidelines and C# conventions, with readability as a priority

Notes

  • Custom verbs, including QUERY, were already sendable via the existing SendAsync(string) / SendAsync(HttpMethod) overloads. This PR doesn't add the ability to send QUERY requests; it adds a first-class, named convenience method for it, matching the DX of the other verbs.
  • The QueryAsync addition is not a breaking change.
  • HttpMethod.Query only exists on .NET 10+, so the string-based "QUERY" fallback is required for netstandard2.0, netstandard2.1, and net6.0 through net9.0.
  • The null-serialization fix changes the wire format of outgoing JSON on net6.0 through net10.0 builds: consumers relying on the (buggy) inclusion of null properties will see a behavior change, though this brings those TFMs in line with the already-correct netstandard2.1 behavior.

@scottoffen scottoffen changed the title Add QueryAsync support for the HTTP QUERY method (RFC 10008) Add QueryAsync support for the HTTP QUERY (RFC 10008) Aug 5, 2026
@scottoffen
scottoffen merged commit 1f43b4d into main Aug 5, 2026
2 checks passed
@scottoffen
scottoffen deleted the add-query branch August 5, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NETSTANDARD2_1_OR_GREATER guard excludes net6.0+ targets, silently disabling NumberHandling/DefaultIgnoreCondition

1 participant