I am using android studio and got me wondering what's the difference of using post and get method request. I know when we use GET METHOD as a request in front end, we would see the request parameters in the url. But in android there aren't any url, so what difference does it make when using post method and get method in android ?
-
how could this be duplicated ? my question was about android studio sending post and get request ? the duplicating question didn't even answer this question – meepwn cloneone Dec 12 '18 at 08:29
1 Answers
Well, The main difference is GET passes request parameter in URL string while POST passes request parameter in request message body which makes it more secure way of transferring data from client to server in http protocol
But if you look more into it, there are any other difference:
First
GET is used for data retrieval only. you can refine what you get from GET METHOD but it is as read only.
While POST is used for send data, But it only like a way to break the simple workings of HTML because you are neither guaranteed of anything that is happening, while it can fetch, send, or delete a data.
Second
GET request can only pass limited amount of data while POST method can pass large amount of data to server
Third
GET is mostly used for view purpose (e.g. SQL SELECT) while POST is mainly use for update purpose (e.g. SQL INSERT or UPDATE).
Fourth
the result of POST may not result in an actual page.
and Lastly
If you have a HIDDEN inputs in form then submitting a GET request reveals that HIDDEN inputs. (PHP GET and POST)

- 164
- 11
-
the last thing you've mentioned. how could it reveal hidden inputs if android applications do not even have urls?. – meepwn cloneone Dec 12 '18 at 07:58
-
It's not like android do not have urls, but yup sorry for the last one, I'm not sure in Android, but it work on PHP. – Serafin William Dec 12 '18 at 08:10