r/angular • • 6d ago

πŸš€ New HTTP QUERY Explained & Angular 22.3 HttpClient.query()

https://youtu.be/1uKuw5a9tPI

The HTTP QUERY method is now supported in Angular v22.3

34 Upvotes

7 comments sorted by

11

u/Responsible-Cold-627 6d ago

What's there to explain? It abides by the rules of GET, but with support for a request body. That's literally it.

4

u/best_of_badgers 6d ago

GET also has support for a request body per the spec, but it’s inconsistently implemented

6

u/toasterboi0100 5d ago

Yea, but JS can't do GET with a body, so as far as this sub is concerned, GET cannot have a body.

2

u/Responsible-Cold-627 5d ago

It can, but really shouldn't it's a gray area in the spec because while you can supply a body, it isn't part of the cache key, meaning the same request with a different body would pull the same thing from a cache, which is not what you want in 99.9% of cases where you add a body to your GET request.

→ More replies (1)

2

u/xinhuj 6d ago

This is a nice feature. I will be experimenting with it. We've definitely written our share of "POST GETs" when the query params got extremely large.

2

u/BlueMooseOnFire 5d ago

Woo glad this got added!