Skip to content

Instantly share code, notes, and snippets.

@adasThePrime
Last active July 4, 2026 02:17
Show Gist options
  • Select an option

  • Save adasThePrime/2da29fcf44654cd888546e3872aafecd to your computer and use it in GitHub Desktop.

Select an option

Save adasThePrime/2da29fcf44654cd888546e3872aafecd to your computer and use it in GitHub Desktop.

HTTP QUERY: A Simple Guide to RFC 10008

Table of Contents

The Problem

Searching data over HTTP has always meant picking between two flawed options:

  • GET: puts your search terms in the URL. Simple, but URLs have length limits (~8,000 characters), and they show up in logs, history, and bookmarks.
  • POST: puts your search terms in the request body, so size isn't an issue. But POST means "this might change something," so browsers and caches won't safely retry or cache it even though a search doesn't change anything.

Developers have been misusing POST for read-only searches for years, just to get around GET's size limit.

The Solution: QUERY

RFC 10008 (June 2026) introduces a new HTTP method, QUERY, that combines the best of both:

  • Like POST, it carries a request body (no size problem).
  • Like GET, it's safe and idempotent (no side effects, safe to retry and cache).

Example request:

QUERY /contacts HTTP/1.1
Content-Type: application/x-www-form-urlencoded

select=surname,email&limit=10&match="email=*@example.*"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[{ "surname": "Smith", "email": "smith@example.org" }]

Key Features

  • Any query language: form data, SQL, GraphQL, etc. The Content-Type header defines the format.
  • Accept-Query header: servers can advertise which query formats they support.
  • Saveable results: a Content-Location header can point to a permanent URL for the result, fetchable later with plain GET.
  • Saveable queries: a Location header can point to a saved version of the query itself, so it can be re-run later without resending it.
  • Caching support: works with If-Modified-Since and other conditional headers, just like GET.

In short: QUERY lets APIs send complex search requests without losing GET's safety, caching, and retry guarantees, fixing a gap developers have worked around for over 20 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment