Back to all questions

Can You Send a Body in a GET Request?

Devs Hive

Devs Hive

Seen on interview: 2 users

This question falls into the category of so-called Tricky Questions. It is asked fairly rarely, and most often when the interviewer sees ElasticSearch in your CV, just to check whether you have really worked with it.

The short answer is YES, you can send a body in a GET request. But it is good form to give a more detailed answer. In general, sending a body in a GET request goes against HTTP semantics, and if you do it, be prepared for the fact that various libraries that parse HTTP requests may not see it.

However, there are exceptions, for example ElasticSearch, which fully supports and uses a body in GET requests. This was done to make it easier to describe complex search queries and to avoid using POST methods for reading data.

Seen on interview?

Comments (2)

Sign in to leave a comment

RR
Alex
November 21, 2025 at 10:23 AM

Це точно. В реальному житті таке краще не юзати 😅

DG
User
November 21, 2025 at 10:04 AM

Треба додати, що браузерні API такі фокуси не дозволяють. Був в мене якийсь цілий скандал з джавистами, які ну дуже хотіли body у GET