Added Json support for POST and PUT operations in restful controller.

Added Json support for POST and PUT operations in restful controllers.

This is particularly handy if you are using a javascript library (such as AngularJS by Google) that uses "Content-Type: application/json" for POST and PUT operations.

This PR detects if the content type is set to json (in request headers) and makes sure that the "create" and "update" methods of the restful controller receive the correct data.

Without this PR, the data is empty and one needs to decode the response body manually.

Change-Id: I11963778fa99d1dd1c523203c25d5a9f53958310