New HTTP method coming soon?

NicolasBrondinBernard

Author
@NicolasBrondinBernard

Is there a new method in the HTTP protocol? What is its purpose?

Article published on 07/02/2022, last updated on 10/08/2026

There are currently 9 different HTTP methods, 7 of which are for "classic" use and 5 generally used in a web project (GET, POST, PUT, PATCH, DELETE).

If you're not already familiar with existing HTTP methods, I advise you to read my previous article first.

Well, a new HTTP method is currently under discussion in order to fill a well-known gap in the semantics of the web protocol.

The proposal is currently recorded in a "draft" RFC, available right here!

The issue

In the introduction, I mentioned a missing piece in HTTP semantics, but what is it exactly?

If you've ever built a somewhat complex REST API, you've probably already run into the following problem:

Let's imagine I want to create an advanced search feature for a resource, with a text search, plus fairly complex filters and sub-filters. I have three issues:

  1. Passing my search, my filters, and my pagination through the parameters of a GET request's URL is complicated, especially if my filter schema is a complex JSON.
  2. If I use a POST request to pass my data in the request body, I break the principle of non-idempotence implied by POST
  3. POST requests are not supposed to be cached, whereas I need caching to optimize my feature.

It's to solve this kind of problem that the "QUERY" method was developed.

The Query method

Here are the (simplified) characteristics of this method:

  • It is idempotent, just like the GET method, since the goal is also to retrieve data
  • It can contain a payload in the request body
  • The response can be cached

These three characteristics reflect the identity of this method, the crossroads between the GET and POST methods, opening up the semantic scope of the protocol.

Some technologies, such as GraphQL, based on the two previously mentioned methods, could, in the future, make use of this new method to avoid twisting the protocol's semantics, for example.

For more information, here is the RFC documenting this future method: https://www.ietf.org/id/draft-ietf-httpbis-safe-method-w-body-02.html


Documerica sur Unsplash

Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet