ky gains a query() helper so callers can send a body with a read-only request.
HTTP QUERY behaves like GET but accepts a request body. Search endpoints want it because a complex filter does not fit comfortably in a URL, and ky rejected it before a request was ever built.
ky keeps an allow-list of HTTP methods. Anything outside it failed at the client, which meant QUERY never reached the server to be rejected on its own terms.
This adds QUERY to that list and exposes ky.query(), matching the shape of the existing helpers. Nothing about body or search-param serialization changed, so a QUERY request is assembled by the same code that assembles a POST.
query() joins get, post, put, patch, head, and delete, taking the same options object.
normalizeRequestMethod only uppercases methods it recognizes. QUERY had to be added there too, not just to the allow-list.
requestMethods is the allow-list and the source of the RequestMethod union, so the two cannot drift.
What this brief could not check
- This brief was written by hand as a design fixture. It is modelled on real work, but no model read a diff to produce it, and its claims should not be relied on.
- CI output was not read, so nothing here rests on a check result.