1
votes

I have built a simple Grails app, with a domain-class and its controller (with the default scaffold functionality).

I want to use this for an Android app.

I had to get my objects in the JSON format, and thanks to stackoverflow it's been easy ;)

Now I have to put data. I should make a POST call to http://localhost:8080/MyApp/person/save with parameters, I suppose. But I can't succeed using RESTClient or other simple utilities/firefox addons that GET/POST data over an HTTP server.

The response web page is an error web page, saying "Property 'name' can't be null" or similar... as if I have no parameters passed. Perhaps I'm not able to make a POST request on a page?! o_O

And how can I enable GET, in Grails, to insert objects?

Thank you.

1

1 Answers

1
votes

Funny, I think I am about 2 weeks ahead of you on a similar project. :)

When you do your Post, be sure and include the ?format=json on the end of your URL and grails will automagically parse the params with no extra code in the controller. Isn't grails wonderful?