Skip to content

Add HTTP QUERY method support#1319

Merged
quinnj merged 1 commit into
masterfrom
codex/query-method-support
Jun 25, 2026
Merged

Add HTTP QUERY method support#1319
quinnj merged 1 commit into
masterfrom
codex/query-method-support

Conversation

@quinnj

@quinnj quinnj commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Adds first-class support for the RFC 10008 HTTP QUERY method across HTTP.jl's client and server-facing APIs.

  • Adds HTTP.query(...), HTTP.query(client, ...), and HTTP.@client helper support without adding a new bare export.
  • Treats QUERY as safe/idempotent for high-level retries and stale reused-connection transport retries.
  • Preserves QUERY method and replayable body across 301, 302, 307, and 308 redirects while keeping 303 rewrite behavior to GET.
  • Canonicalizes the Accept-Query header and documents QUERY request usage.
  • Adds live client/router tests plus redirect, retry, transport, and header coverage.

Validation

  • julia --project=. test/runtests.jl
  • julia --project=docs docs/make.jl
  • Fresh temp-env focused run with clean Reseau 1.3.1 checkout: http_core_tests.jl, http_handlers_tests.jl, http_client_tests.jl, http_client_transport_tests.jl

Note: the local checkout has an untracked manifest pointing at an older dirty ~/.julia/dev/Reseau, so the final focused verification used a temporary clean Reseau 1.3.1 checkout to match the current master compat.

Co-authored by Codex

@quinnj quinnj force-pushed the codex/query-method-support branch from 9c386db to 48814f7 Compare June 24, 2026 04:13
@quinnj quinnj marked this pull request as ready for review June 24, 2026 04:19
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.82%. Comparing base (a1eb82b) to head (79e4818).

Files with missing lines Patch % Lines
src/http_client.jl 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1319      +/-   ##
==========================================
+ Coverage   87.67%   87.82%   +0.15%     
==========================================
  Files          30       30              
  Lines       11739    11769      +30     
==========================================
+ Hits        10292    10336      +44     
+ Misses       1447     1433      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quinnj

quinnj commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Reviewed against RFC 10008 — the implementation looks correct and complete.

The redirect matrix is the subtle part and it's exactly right: QUERY is preserved on 301/302/307/308 and only rewritten to GET on 303, matching §2.5 — including the easy-to-miss note that "the exceptions for redirecting a POST as a GET after a 301 or 302 do not apply to QUERY." (Verified the preserved-method path carries the body via _copy_request and is still gated by _redirect_body_replayable, same as 307/308 POST.) Safe + idempotent retry treatment at both the high-level (_retryable_request_method) and stale-connection (_retryable_method) layers, Accept-Query canonicalization, the query/query(client,…)/@client surface with no new bare export, and the e2e router test all check out.

One QUERY-specific nuance worth considering (non-blocking): §2/§2.1 makes Content-Type a hard requirement — a server MUST fail a QUERY whose Content-Type is missing (400), unlike POST where a missing type is usually tolerated. Dict/NamedTuple bodies auto-set application/x-www-form-urlencoded, so those are covered, but a raw string/bytes body relies on the caller to set it (the JSON doc example does). Since a missing type is a guaranteed round-trip-to-400 for QUERY specifically, it might be worth failing fast client-side (a warning, or surfacing it) when a QUERY carries a non-empty body without Content-Type — purely optional.

[findings generated by claude]

@quinnj quinnj force-pushed the codex/query-method-support branch 4 times, most recently from def72cd to 7833e08 Compare June 24, 2026 05:31
@quinnj quinnj force-pushed the codex/query-method-support branch from 7833e08 to 79e4818 Compare June 24, 2026 05:50
@quinnj quinnj merged commit c70d49a into master Jun 25, 2026
8 checks passed
@quinnj quinnj deleted the codex/query-method-support branch June 25, 2026 16:10
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.

1 participant