REST APIs demo. REST API implementation using
0. Java
1. Jersey
2. Servlet Container: Tomcat 8.5
3. JSON: XMLRootElement
Rules regarding "return" returning Object from the REST API method().
-
- MediaType.TEXT_PLAIN,MediaType.TEXT_HTML MUST return String.
-
- MediaType.APPLICATION_XML, APPLICATION_JSON MUST return Object, with class annoted with XMLRootElement.
-
- MediaType.TEXT_XML can either return String or an Object.