The difference between the Get and post method compared to HTTP and REST

I am new to REST. I want to know when to use get methods and when to use post methods. In the process of my study of literature, I came across this knowledge.

Actually, when I looked for the HTTP and post methods, I read that get does not encode the URL and does not send the URL URL

When I looked for get and post methods for relaxing, I read that the get method is used to retrieve data from the server, and the post method is used to add some data to the server.

But I also read that rest is nothing more than an agreement to use HTTP.

Therefore, I feel that some things contradict here. Are HTTP methods different?

Please clarify. Any suggestions on when to use the methods of obtaining and publishing are also welcome.

Resource from which I got this information:

https://www.ibm.com/developerworks/webservices/library/ws-ful/

http://www.cs.tut.fi/~jkorpela/forms/methods.html

+8
rest web-services client-server
source share
2 answers

GET should be used to retrieve the resource. This operation should be idempotent, that is, it should not change any state on the server.

POST should be used to add new information to the server. This is usually done at the URL, which is a "container" of resources. POST will add a new resource to this container.

PUT should be used to update an existing resource.

REMOVAL should be obvious.

You might like to read the following: http://tomayko.com/writings/rest-to-my-wife

+11
source

The part of your question that has not yet received any attention, and which probably causes some of your confusion, is this: "REST is nothing more than an agreement to use HTTP." Which is an inaccurate way of describing what REST is / does in terms of its use of HTTP to control the state of the application. This is officially known as HATEOAS - http://en.wikipedia.org/wiki/HATEOAS and is pretty much the foundation of the RESTful web services concept.

0
source

All Articles