Skip to main content

QUERY( ): New HTTP Method

GET Request with a body.

Updated 3 min readMarkdown
QUERY( ): New HTTP Method

A new HTTP Method:

The Internet Engineering Task Force (IETF) officially released and standardized the new HTTP query method in June 2026 under RFC 10008. This marks the first major core addition to the HTTP protocol verbs since PATCH was standardized in 2010.

Why we need it?

In order to understand this question, we may have to understand GET and POST method first and see what was the pain point and how does it solve for it.

GET( )

According to REST API rules, GET Method is used to fetch data. It does not change anything in database. It just fetch some resources and give them to the application using it. For example, if you want to get a list of users, you will send the GET reqeust on the URL, for example:

GET /api/users

It is a simple GET request. In bigger platforms, the GET requests are not this simple. They are very complex. Lets suppose you want to fetch users whose first name is "Muhammad", they are from Pakistan and their age in 19, you can add this in the query parameters. e.g.

GET /api/users?first_name=Muhammad&location=Pakistan&age=19

So if we want to add filters on the results that we want we have to add them in query parmaters. But as the query parameters increase, the URL keep getting longer and it has 2 problems.

  1. Less Readability

  2. Characters Limit in URL (~2000 for Chrome)

It means that if this URL keep increasing, a time wil come that it exceeds that limit.

POST ( )

On the other hand POST method is used to create a resource. For examle when a new user is registered to our platform, we use POST method to create a user in database and we can also send payload wtih POST request.

POST /api/users/search 
Content-Type: application/json
{
  "name":"Muhammad Yasir",
  "email":"myemail@gmail.com"
}

Since we can send a payload with POST method, developers started usnig POST method with a new URL to fetch resources instead of creating new one.

For example if we want to same users again with post request, we can do something like:

POST /api/get-users HTTP/1.1
Content-Type: application/json

{
  "first_name": "Muhammad",
  "location": "Pakistan",
  "age": 19
}

Now there is no limit to payload and also it is more readable. But there is also a problem with POST request. You cannot cache the POST request.

QUERY( )

This new method query is similar to GET but you can also send the payload with it. And since it is same as GET method, you can also cache this as well.

Now if we do the same request using this new method, here is how it will look like:

QUERY /api/users
Content-Type: application/json

{
  "first_name": "Muhammad",
  "location": "Pakistan",
  "age": 19
}

So now no matter how long the payload gets, you can always write it and make it more readable as well. and it is also cacheable as well

17 views

No comments yet. Be the first to comment.