Full Stack Developer (Java) Question:
Tell us what’s the difference between GET and POST?
Answer:
Both are methods used in HTTP requests. Generally it is said that GET is to download data and PUT is to upload data. But we can do both downloading as well as uploading either by GET/POST.
☛ GET:
If we are sending parameters in a GET request to the server, then those parameters will be visible in the URL, because in GET, parameters are append to the URL. So there’s a lack of security while uploading to the server.
We can only send a limited amount of data in a GET request, because the URL has its max limit and we can not append a long data string to the URL.
☛ POST:
If we are using POST then we are sending parameters in the body section of a request. If we send data after using encryption in the body of an http request, it’s quite a bit more secure.
We can send a lot more data using POST.
☛ GET:
If we are sending parameters in a GET request to the server, then those parameters will be visible in the URL, because in GET, parameters are append to the URL. So there’s a lack of security while uploading to the server.
We can only send a limited amount of data in a GET request, because the URL has its max limit and we can not append a long data string to the URL.
☛ POST:
If we are using POST then we are sending parameters in the body section of a request. If we send data after using encryption in the body of an http request, it’s quite a bit more secure.
We can send a lot more data using POST.