HTTP QUERY: Between GET and POST — What's New for Spring Boot and Angular?

HTTP QUERY: Between GET and POST — What's New for Spring Boot and Angular?

Do you remember the discussion you had with your colleagues? To retrieve data with a big set of parameters should we use GET or POST? The problem of GET is that the body semantic is not defined. Some servers and intermediaries may reject or ignore the JSON body of the request (it's not mandatory in the RFC) and POST (that assume that you have a body in the message) could modify the data (not safe or idempotent) and for this reason it has to be handled with precaution.

Since June 2026 we can probably close the debate and start using a new method: HTTP QUERY.

Current status

The examples with Angular and Spring will come soon, currently (November 2026) neither framework has published a stable release with dedicated QUERY support yet. Angular should support it from 22.3 and Spring from 7.1. They are currently in RC.

Version introducing support Status on November 17, 2026
Spring Framework 7.1.0-M2 7.1.0-RC2 available
Angular 22.3.0 22.3.0-rc.0 available
HTTP QUERY RFC 10008 Published in June 2026

HTTP QUERY - The theory

RFC 10008: The HTTP QUERY Method
This specification defines the QUERY method for HTTP. A QUERY requests that the request target process the enclosed content in a safe and idempotent manner and then respond with the result of that processing. This is similar to POST requests, but QUERY requests can be automatically repeated or restarted without concern for partial state changes.

The RFC 10008 addressed the problem of the complex read-only HTTP requests.

Here is an extract from their page:

Table 1: Summary of Relevant Method Properties
GET QUERY POST
Safe yes yes potentially no
Idempotent yes yes potentially no
URI for query itself yes (by definition) optional (Location response field) no
URI for query result optional (Content-Location response field) optional (Content-Location response field) optional (Content-Location response field)
Cacheable yes yes yes, but only for future GET or HEAD requests
Content (body) "no defined semantics" expected (semantics per target resource) expected (semantics per target resource)

The RFC doesn't introduce only a new HTTP method, but it extend existing features:

Feature Description
Accept-Query (new) The server tells the client which query formats it accepts, for example JSON or SQL.
Content-Type The client specifies the format of the query body, for example application/json. This header is mandatory for QUERY.
Location The server can provide a URL to execute the same search again using GET, potentially returning updated results.
Content-Location The server can provide a URL to retrieve the results of the search that has just been executed.
Caching If two clients execute the same query, a cache may reuse the previous response. The request body must be considered when identifying cached responses.
Conditional requests The client can use headers such as If-None-Match to avoid downloading results that have not changed.
Automatic retries If a network error occurs, the client can repeat the request without risking unintended changes to the target resource.

MDN


Here are some examples from the MDN page:

In this example we send an SQL query with application/sql

QUERY /contacts HTTP/1.1
Host: example.org
Content-Type: application/sql
Accept: application/json

SELECT surname, email FROM contacts LIMIT 10

In the second example we use the body to send the content usually found in the query parameters:

QUERY /contacts HTTP/1.1
Host: example.org
Content-Type: application/x-www-form-urlencoded
Accept: application/json

select=surname,givenName,email&limit=10&email=%2A%40example.%2A

HTTP Query with Spring and Angular

After the theory we have to see the real implementation and how this changes our daily development activity.

At the moment there is no urge to change, not all the frameworks support this change.

Spring Framework, from 7.1.0

Spring will support the new HTTP method from Release 7.1.0, the new feature has been added in the M2 https://github.com/spring-projects/spring-framework/releases/tag/v7.1.0-M2.

Here you find the GitHub discussion and the link to the PR: https://github.com/spring-projects/spring-framework/pull/34993

The annotation should be :

@RequestMapping(method = RequestMethod.QUERY)

Angular, from 22.3

Angular will support the new HTTP QUERY from the release 22.3
https://github.com/angular/angular/commit/effbe56432499b961b0c8ad97e4777c310923cad

You will be able to use the new HttpClient.query():

this.http.query<Product[]>('/api/products', {
  category: 'laptop',
  maxPrice: 2000
});

but you can already use a generic http.request:

this.http.request<Product[]>('QUERY', '/api/products', {
  body: {
    category: 'laptop',
    maxPrice: 2000
  }
});

Summary

HTTP Query is not intended to replace any existing method, but it tries to fill the gap between simple GET requests and POST complex bodies.

Which HTTP method is recommended for different use cases:

Use case Example Method Reason
Retrieve a resource by ID /customers/123 GET Simple resource retrieval
Retrieve a collection /products GET No request body required
Simple filtering /products?category=laptop GET Easily expressed through URL parameters
Pagination and sorting /products?page=1&sort=price GET Simple and bookmarkable
Complex search with nested filters /products/search QUERY Structured search criteria
Advanced full-text search /documents/search QUERY Complex search expressions
Read-only reporting and analytics /sales/analytics QUERY Multiple dimensions and aggregations
Geospatial search with complex geometry /locations/search QUERY Large or structured spatial data
Read-only GraphQL operations /graphql QUERY Safe execution, when supported
Create a new resource /customers POST Resource creation
Execute a business operation /payments POST Potential server-side state changes
Generate and persist a report /reports POST Creates a new resource
Complex search on legacy infrastructure /products/search POST Compatibility when QUERY is unsupported