Sending payload in an HTTP GET request

preview_player
Показать описание

Build Your Own Redis / DNS / BitTorrent / SQLite - with CodeCrafters.

In this video, I debunk the myth that you cannot send data in an HTTP GET request. While it's not recommended, it's indeed possible as per the HTTP 1.1 specifications. I explain how web servers can process data in the request payload and demonstrate it with a simple Python Flask example. I discuss how popular tools like Elasticsearch used HTTP GET requests for complex queries in the past. Although not encouraged, sending data in an HTTP GET request is feasible, but caution should be exercised due to potential compatibility issues with older implementations.

# Recommended videos and playlists

If you liked this video, you will find the following videos and playlists helpful

# Things you will find amusing

# Other socials

I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.

Thank you for watching and supporting! it means a ton.

I am on a mission to bring out the best engineering stories from around the world and make you all fall in
love with engineering. If you resonate with this then follow along, I always keep it no-fluff.
Рекомендации по теме
Комментарии
Автор

An interesting fact: Postman actually allows you to send request body when using GET.

pbakshi
Автор

To add to your browser example where client is not able to send request body in GET, if you depend on GET with request body (for example for search), you should also implement other methods (POST in most cases) to be compatible with client implementations which don't allow sending request body using GET. Elasticsearch allows both GET and POST for the search API example above for same reason.

akshatgoel
Автор

Very detailed and informative. Thank you.

gauravgupta
Автор

Great information! I have used POST to get information when inputs are complex though semantically it is awkward :) I am going to evaluate my options based on this information now. Thanks!

pawanmahalle
Автор

I have made a habit of watching atleast 1 video of yours daily, enjoying each bit of your videos!

scoopedcontent
Автор

The knowledge is not new, but when you said it .... 🔥

shreyas_._
Автор

great info, before we use post for complex get request

ishanmay
Автор

unknowingly the fact, we are using post method to get the Okta Token and pass the Token to other API to post the body. We have to change the conviction. AWS API gateway support sending the key, value pair ??

coincidentIndia
Автор

Elastic search is popular in this scenario where we use get request with payload.

venkatapavankumarsannisett
Автор

this is something that I was curious about for a while...thanks Arpit!
Keep doing great work as always :)
#AsliEngineering

notKnown
Автор

Super interesting. Never paid attention to the fact that elastic search uses request body with GET. Now that I have a hammer, I am going to look for the nail. :smile:

anshul_eie
Автор

but sending the payload in body instead of query params in case of GET call would lead to REST INCOMPLIANCY right?

skt
Автор

which note making app do you use arpit sir?

shubhamvashishtha
Автор

Great content, would like add one point.
With http get there's a limit with payload content, usually one of the reason why POST verb is suggested !

amitpathak
Автор

It was really informative but now I have one question it may sound a little stupid but Why are different HTTP methods present. Can't we handle all requests using GET only then we are able to send payload in GET request

techdemy
Автор

Use ASGI and this whole problem vanishes.

SorFig