The Java API for RESTful Web Services provides portable APIs for developing, exposing and accessing Web applications designed and implemented in compliance with principles of REST architectural style.
base_url is http://localhost/restapp/api
Back End Database is MySQL database;
-
Import this (maven) repository into any Java EE IDE with Tomcat Installed.
-
Import
src/main/resources/friends.sqlin anymysqldatabase; -
Change
mysqlconfiguration insrc/main/resources/mysql.properties. -
Run
Maven Cleanthrough IDE or Command Line. -
Run on Tomcat Server or
maven installand copytarget/restapp.warinto$TOMCAT/webapps/directory.
Add chrome extension Postman which is a REST Api Client to test this application.
| HTTP Method | Path | Action | Fields |
|---|---|---|---|
| GET | /users | index | |
| GET | /users/{user_id} | index | |
| POST | /users | Add | rollno (int), name, email, phone and company with header Content-Type: application/x-www-form-urlencoded |
| PUT | /users/{user_id} | update | rollno (int), name, email, phone and company with header Content-Type: application/x-www-form-urlencoded |
| DELETE | /users/{user_id} | destroy |
- Add OAuth 2.0 Support