Announcement Announcement Module
No announcement yet.
REST: JSON and HTML response after POST request Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • REST: JSON and HTML response after POST request

    Hi Guys,

    I want to implement a REST-service. I stoped on the moment when I need to handle POST request. E.g. I want to send form with some data:

    producer: samsung
    model: galaxy s2
    price: 680

    And after that depends on URL sufix (.json or .html) I want to receive a response with JSON-document or HTML-document appropriately.

    I use CNVR and I have already implemented adding of a new record to a database via simple controller which returns ModelAndView. Also I created controller which returns a list of records in HTML and JSON format depends on URL sufix.

    I would like to see what is best practices in solving of this problem.