Reza
Reza

Reputation: 739

RESTful Web Service In Grails

I made an OCR service using Grails and everything is working very well. I want to make a Web Service for it. The input of the RESTfull WS should be in mime format (the client will send some images and related information in XML format to this WS). How could I implement this in Grails? Any Sample codes to guide me?

Thanks,

Reza

Upvotes: 1

Views: 200

Answers (1)

Hans Westerbeek
Hans Westerbeek

Reputation: 5805

These days, most people do by writing one or more controllers that accept and return text/json (or text/xml if you really want).

Grails has great libraries on board for parsing these requests, all of which are part of the Groovy language:

I have used the approach above successfully on a project. You will end up with Controllers that are easy to unit test, which is a huge productivity win.

Upvotes: 1

Related Questions