0

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.

lucke84
  • 4,516
  • 3
  • 37
  • 58

1 Answers1

2

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?

Community
  • 1
  • 1
Marco
  • 15,101
  • 33
  • 107
  • 174
  • Thanks, it seems that grails doesn't follow the REST way completely to choose HTTP method for each action. – Rgnrtn Cifer Mar 28 '13 at 13:24
  • You can bend Grails as you like, if you take a look how to build a REST interface with Grails it follows the REST way completely. The controller methods are protected with the HTTP verbs for your convenience also. – Marco Mar 28 '13 at 13:34