4006 views • Backend System Design
It is a common myth that we could not pass the request body in the HTTP GET request. HTTP 1.1 specification neither enforces nor suggests this behavior.
This means it is up to implementing the application web servers- Flask, uWSGI, etc.- to see if it parses the request body in the HTTP GET request. To do this, just check the request object you would be getting in your favorite framework.
Say you are modeling an analytics service like Google Analytics in which you are exposing an endpoint that returns you the data point depending on the requirements. The requirements specified here could be a large, complex JSON.
Passing this query in the URL of the GET request as a query param is not convenient as it would require you to serialize and escape the JSON string before passing.
This is a perfect use case where the complex JSON query can be passed as a request body in the HTTP GET request, giving a good user experience.
Yes. ElasticSearch- one of the most popular search utilities, uses this convention.
The search endpoint of ElasticSearch is a GET endpoint where the complex search queries in JSON format are sent in the request payload.
If you like what you read subscribe you can always subscribe to my newsletter and get the post delivered straight to your inbox. I write essays on various engineering topics and share it through my weekly newsletter.
944 views • 46 likes • 2022-05-27
One of the simplest deployment strategies that make deployment a breeze is Rolling Deployment. It is the most widely ado...
1309 views • 60 likes • 2022-05-18
Deployments are a pain if we are unsure about our release changes. But sometimes even if we know our changes well, somet...
1982 views • 117 likes • 2022-05-16
Deployments are stressful; what if something goes wrong? What if you forgot to handle an edge case that was also missed ...
A set of courses designed to make you a better engineer and excel at your career; no-fluff, pure engineering.
Being a passionate engineer, I love to talk about a wide range of topics, but these are my personal favourites.
Arpit's Newsletter read by 17000+ engineers
🔥 Thrice a week, in your inbox, an essay about system design, distributed systems, microservices, programming languages internals, or a deep dive on some super-clever algorithm, or just a few tips on building highly scalable distributed systems.
Powered by this tech stack.