<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahul Deo on Medium]]></title>
        <description><![CDATA[Stories by Rahul Deo on Medium]]></description>
        <link>https://medium.com/@inform.rahuldeo?source=rss-e790436f3800------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Xig1enys8mePceK3</url>
            <title>Stories by Rahul Deo on Medium</title>
            <link>https://medium.com/@inform.rahuldeo?source=rss-e790436f3800------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:36:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@inform.rahuldeo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond GET and POST: How the New HTTP QUERY Method Changes API Design Forever]]></title>
            <link>https://medium.com/@inform.rahuldeo/beyond-get-and-post-how-the-new-http-query-method-changes-api-design-forever-a9ae5b20f7d3?source=rss-e790436f3800------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9ae5b20f7d3</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[rest-api-architecture]]></category>
            <dc:creator><![CDATA[Rahul Deo]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 05:27:48 GMT</pubDate>
            <atom:updated>2026-07-12T05:27:48.032Z</atom:updated>
            <content:encoded><![CDATA[<p>The IETF has finally closed a 16-year gap in the HTTP protocol. Say goodbye to the existential dread of POST /search</p><h3>Introduction</h3><p>For as long as REST APIs have existed, backend developers and architects have faced an awkward choice that felt less like software engineering and more like picking the lesser of two protocol evils whenever they needed a complex, read-only operation.</p><p>On one hand, GET is the semantically &quot;correct&quot; choice for fetching data. It is safe, idempotent, and highly cacheable. However, GET is also a minimalist who absolutely refuses to carry luggage. It cannot reliably carry a request body, forcing us to cram complex filters, nested arrays, and sorting parameters into a URL query string until it looks like a cat walked across the keyboard. These monstrosities quickly run straight into web server length limits and break things.</p><p>On the other hand, we have POST. It happily carries a heavy, structured JSON payload. But by default, HTTP treats POST as a state-changing operation. It’s the protocol equivalent of asking a waiter what&#39;s on the menu, and they assume you just ordered 500 pizzas. It completely breaks HTTP caching, kills automatic request retries, and violates idempotency guarantees.</p><p>In June 2026, the Internet Engineering Task Force (IETF) finally decided we had suffered enough. Co-authored by engineers from Cloudflare and Akamai alongside HTTP specification veteran Julian Reschke, <strong>RFC 10008</strong> standardizes a brand-new HTTP method: <strong>QUERY</strong>. This marks the first genuinely new HTTP method added to the protocol since PATCH (RFC 5789) was introduced back in 2010—a 16-year gap, which in tech years is roughly three geological eras.</p><p>QUERY elegantly combines the body-carrying flexibility of POST with the safe, &quot;look but don&#39;t touch&quot; semantics of GET. It gives API designers a standards-backed way to say: <em>&quot;I have a complex, rich payload, but I promise I&#39;m strictly just reading data.&quot;</em></p><h3>The Core Problem QUERY Solves</h3><p>To appreciate why this matters, look at a typical modern search endpoint using a traditional GET request:</p><pre>GET /search?category=books&amp;price_max=50&amp;tags=fiction,bestseller&amp;sort=relevance HTTP/1.1</pre><p>This functions perfectly fine for straightforward filtering. But what happens when your query requires complex, nested structures, multi-layered object arrays, or free-text search terms with sensitive special characters? URL encoding becomes an unreadable, brittle nightmare.</p><p>Furthermore, request URIs are incredibly exposed. They pass transparently through proxies, load balancers, browser histories, and server access logs. If your search filter includes sensitive user data or private identifiers, baking them into a URL means you’ve essentially written your private data on a postcard for any intermediate system to read.</p><p>To circumvent this, the industry’s universal workaround has been to misuse POST:</p><pre>POST /search HTTP/1.1<br>Content-Type: application/json<br><br>{<br>  &quot;category&quot;: &quot;books&quot;,<br>  &quot;price_max&quot;: 50,<br>  &quot;tags&quot;: [&quot;fiction&quot;, &quot;bestseller&quot;],<br>  &quot;sort&quot;: &quot;relevance&quot;<br>}</pre><p>While this cleanly handles the payload, it introduces a massive protocol lie. Because POST signals a potential state change, network infrastructure assumes the request might modify data on the server. Consequently, automatic caching is disabled, and safe automatic retries are blocked. If a POST request times out over a choppy mobile network, the client cannot safely resend it automatically because the server might have already processed a database write.</p><p>QUERY natively resolves this identity crisis.</p><h3>What QUERY Looks Like in Practice</h3><p>According to RFC 10008, a QUERY request instructs the server to process the enclosed body in a completely safe and idempotent manner, returning the matching dataset. It is functionally similar to a POST, but explicitly safe, cacheable, and retriable because it guarantees zero server state changes.</p><h3>A Basic Example</h3><p>Here is how a standard administrative filter looks using the new method:</p><pre>QUERY /users HTTP/1.1<br>Host: example.org<br>Content-Type: application/json<br><br>{<br>  &quot;role&quot;: &quot;admin&quot;,<br>  &quot;sort&quot;: &quot;name&quot;,<br>  &quot;page&quot;: 1<br>}</pre><p>The server processes this JSON body as the formal query definition and returns the matching results, effortlessly handling a structured input payload without polluting the URL.</p><h3>A Search-Style Response Flow</h3><p>For a more advanced contacts search, the client and server communicate smoothly via JSON:</p><p><strong>The Request:</strong></p><pre>QUERY /contacts HTTP/1.1<br>Host: example.org<br>Content-Type: application/json<br>Accept: application/json<br><br>{<br>  &quot;filters&quot;: {<br>    &quot;surname&quot;: &quot;Smith&quot;,<br>    &quot;city&quot;: [&quot;Berlin&quot;, &quot;Munich&quot;]<br>  },<br>  &quot;sort&quot;: &quot;givenname&quot;,<br>  &quot;limit&quot;: 20<br>}</pre><p>The Response:</p><pre>HTTP/1.1 200 OK<br>Content-Type: application/json<br><br>[<br>  { &quot;surname&quot;: &quot;Smith&quot;, &quot;givenname&quot;: &quot;John&quot;, &quot;email&quot;: &quot;john@example.org&quot; },<br>  { &quot;surname&quot;: &quot;Smith&quot;, &quot;givenname&quot;: &quot;Anna&quot;, &quot;email&quot;: &quot;anna@example.org&quot; }<br>]</pre><h3>Why Call It QUERY Instead of SEARCH?</h3><p>Interestingly, the HTTP protocol already possessed three safe, body-carrying methods: PROPFIND, REPORT, and SEARCH. However, these were strictly tied to the WebDAV extension ecosystem—which most developers today view as a historical relic.</p><p>While early drafts of RFC 10008 actually utilized the name SEARCH, the HTTP Working Group ultimately pivoted to QUERY. The name maps cleanly to the traditional &quot;query string&quot; component of a URI and describes a completely generic, read-only data operation rather than implying a specialized search-engine use case.</p><h3>7 Crucial Technical Realities of the Spec</h3><p>Implementing QUERY requires understanding several core architectural shifts introduced by the new specification:</p><p><strong>1. Safe and Idempotent by Registration:</strong> The IANA HTTP Method Registry officially lists QUERY alongside GET as both safe and idempotent. This isn&#39;t just a gentleman&#39;s agreement; it&#39;s a protocol-level guarantee that clients, CDNs, and network intermediaries can safely rely on.</p><p><strong>2. The </strong><strong>Accept-Query Header:</strong> Servers can now advertise which media types they accept for incoming queries using the new Accept-Query response header. Clients can discover this capability beforehand by issuing a polite HEAD request:</p><pre>HEAD /search HTTP/1.1<br>Host: example.org</pre><pre>HTTP/1.1 200 OK<br>Allow: GET, QUERY, HEAD<br>Accept-Query: application/json, application/xml</pre><p><strong>3. Defined Failure Semantics:</strong> The specification explicitly outlines how servers must handle malformed or unsupported payloads so your backend doesn’t have to guess:</p><ul><li>400 Bad Request: Your Content-Type is missing or inconsistent.</li><li>415 Unsupported Media Type: The server does not accept that specific format for query processing.</li><li>422 Unprocessable Entity: The body is syntactically valid JSON/XML, but the query semantics inside make absolutely no sense to the backend.</li></ul><p><strong>4. The Caching Conundrum:</strong> While QUERY is entirely cacheable, its implementation introduces a brand-new flavor of caching bugs. Unlike GET, where the URL serves as the primary cache key, a QUERY cache key <strong>must incorporate the request body</strong>. Caches that fail to hash or normalize request bodies correctly risk cache poisoning or cache deception bugs.</p><p><strong>5. Compatibility with Conditional Requests:</strong> If a server chooses to expose a complex query as a standalone, temporary resource (e.g., redirecting via a 303 See Other to a specific results URI), clients can issue standard conditional GET requests using If-None-Match or If-Modified-Since to check for updates efficiently without re-sending the massive query body over the wire.</p><p><strong>6. CORS Preflight is Mandatory:</strong> Unlike GET, QUERY is <em>not</em> one of the CORS-safelisted methods. Any cross-origin QUERY executed via browser JavaScript will automatically trigger an initial OPTIONS preflight request, giving your browser a chance to ask permission before transmitting the actual payload.</p><p><strong>7. Built-in Privacy Protection:</strong> By moving sensitive parameters from the URL string into the payload body, QUERY ensures that private filters are kept away from plain-text access logs, intermediate proxies, and local browser histories.</p><h3>When Not to Use QUERY</h3><p>The IETF is quite candid about this: QUERY is not designed to be a wholesale replacement for GET on every single read endpoint.</p><p>If your data requests are short, straightforward, and easily represented by basic key-value pairs, stick to standard GET requests. QUERY is specifically intended for scenarios where a URL-encoded query string becomes entirely impractical due to massive payloads, deeply nested object filtering, or strict data privacy demands.</p><p>Additionally, remember that QUERY does not magically reduce backend resource strain. Even though it guarantees zero state changes to a resource, it is not a &quot;zero-write&quot; operation at the database level. It will still heavily hit database indexing, generate replica read load, and incur cloud billing costs—much to the dismay of your finance department.</p><h3>Current Industry Adoption (As of July 2026)</h3><p>Because the RFC is barely a month old, ecosystem support is a bit of a mixed bag across different layers of the modern web stack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yeyI0lJSDQwDeeiYoUvaw.png" /></figure><h3>A Practical API Adoption Checklist</h3><p>If you are planning to introduce the QUERY method into your next production microservice design, run through this practical engineering checklist:</p><ol><li><strong>Audit Existing Workarounds:</strong> Scan your architecture for POST /search or POST /filter endpoints. These are your primary candidates to upgrade to QUERY.</li><li><strong>Review Network Infrastructure:</strong> Double-check your Web Application Firewalls (WAFs), reverse proxies, and API gateways to ensure their security allowlists won’t silently drop an unfamiliar HTTP method.</li><li><strong>Verify Caching Keys:</strong> If you utilize intermediate caching layers, ensure your caching software is updated to correctly generate cache keys utilizing the serialized request body, rather than just the URL string.</li><li><strong>Prepare for Preflights:</strong> Account for the added network latency of an extra OPTIONS round-trip if your endpoint is consumed cross-origin via browser-based JavaScript.</li><li><strong>Enforce Accurate Status Responses:</strong> Align your backend validation errors precisely with the spec, implementing proper 400, 415, and 422 responses for poorly formed queries.</li><li><strong>Deploy Incrementally:</strong> Do not aggressively migrate external production traffic unless you explicitly control both sides of the client-server connection. Experiment safely using internal microservice communication or lightweight middleware layers first.</li></ol><h3>Final Thoughts</h3><p>The QUERY method finally resolves a foundational architectural gap that developers have spent over a decade hacking around. By standardizing safe, body-carrying read operations under RFC 10008, the IETF has brought semantic purity back to web API design.</p><p>While the protocol itself handles it perfectly today, the true bottleneck over the coming months will be updating the vast matrix of frameworks, firewalls, and gateways built over the last twenty years. Expect this tooling gap to steadily disappear throughout the remainder of 2026 and 2027. Until then, happy querying!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9ae5b20f7d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>