- X 2
There are grey areas and complexities which I haven't mentioned, as there always are in questions of this type, but that's the general idea.
For example if my request is supposed to make a dentist appointment for me next Tuesday at 11 AM, that would be a POST request because that information is going to be stored at the server. However if my request is supposed to find out what times are available for appointments on Thursday, that would be a GET request.
caushik conjetty sekhar wrote:Use GET method when you want to bookmark your page or retrieve simple data.
Complexity of the data is irrelevant. The GET method should be used to get data regardless of whether it is complex or simple.
GET is not secure since the data is appended in the URL, in POST data is sent in the body so the data is not seen to outside world.
This is a popular myth, and is completely wrong.
Just because POST data is in the body of the request it is no more secure than data placed on the URL. All unencrypted data sent over the Internet is visible to anybody along the way.
POST is in no way more secure than GET, and GET is no less secure than POST. If you want to protect the data, use SSL to encrypt the transmitted data.
RajeshKumar Nayak wrote:fist Declare post method
inside the post method you declare
No, that's not all. You cannot declare one method inside another. What on Earth are you talking about?
Even so, another myth is that EGT and POST are interchangeable. They are not as described above. Each is used for different purposes.