The code generated in controllers for domain classes allowed POST method only for 'save', 'update' and 'delete'. Does this only because of that the GET method would show the params in the URL or it is out of other considerations? Like the semantic of GET is for obtaining while POST is for creating or updating?

I'm using Grails 2.1.1.

有帮助吗?

解决方案

The consideration you mention is correct, when posting data you would not want to get that data into your URL. This could be cached etc. Another consideration is that more and more frameworks are following the REST principle in which is described what each HTTP method would be doing.

There is some more information over here: Which HTTP methods match up to which CRUD methods?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top