Hi there! loving your course.
I came across a question and the answer intrigued me but left me wondering why.
in the quote below, can you folks share why we can’t do this in practice? (“But in practice, we can’t send the parameters in the request body of a GET
method”). Is it because of caching or something else?
"Can we send parameters in the request body of a GET
request instead of the URL?
Theoretically, sending parameters in the body of a GET
request is possible. But in practice, we can’t send the parameters in the request body of a GET
method. Even if we do send them this way, the server should ignore them. Usually, the length of the URL is also limited. If the limit is exceeded, then we can use the POST
method to pass parameters in the request body. However, GET
has the advantage of being slightly faster than POST
because there is no request body.
"
Course: https://www.educative.io/courses/grokking-the-api-design-interview
Lesson: https://www.educative.io/courses/grokking-the-api-design-interview/JQjM6Z9Dk1y