unjs / unjs/ofetch

Add support for RFC 10008 - HTTP QUERY

Open Beginner friendly
#610 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.4k
Forks
195
PR merge metrics
No merged PRs in 30d

Description

Describe the feature

The HTTP QUERY method has now been accepted by the IETF as a proposed standard - https://datatracker.ietf.org/doc/html/rfc10008. It has also been accepted as part of the OpenAPI 3.2 standard - https://www.openapis.org/blog/2025/09/23/announcing-openapi-v3-2

Since the purpose of QUERY is to accept a body payload rather than the confusion of whether to use POST for idempotent queries that are longer than a standard GET query string allows, it needs adding to the set of payloadMethods alongside PATCH, POST, PUT, and DELETE.

Without this change, the raw JS object will be passed through to fetch, causing either a TypeError or, potentially, for [object Object] to be sent instead.

I'll shortly open a one-line PR for this change.

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the codebase for the payloadMethods list alongside the existing PATCH, POST, PUT, and DELETE handling, then read how its values are passed to fetch. Add QUERY to that list and verify that a raw JavaScript object is handled as a request body rather than passed directly to fetch.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.