This is a simple Spring boot REST application. The application is developed based on a tutorial series - Spring Boot Quick Start: by Java Brains. The project is diployed on Heroku.
Entities
Topic Course
--------- ----------
ID:String::Primary Key ID:String::Primary Key
NAME:String NAME:String
DESCRIPTION:String DESCRIPTION:String
TOPIC:Object of Topic entity
Here TOPIC in Course entity is object of Topic entity and it creates a ONE-TO-MANY relationship, where ONE Topic may have MANY Courses.
Note: Since the project is just for practis, the url may not respond some time. USE POSTMENT TO TEST THIS REST API
-
To GET all the topics in the server visit fallowing url
-
To POST any new topic we need to send a POST request along with some payload contaning
Content-Type
flag in header set toapplication/json
. To send/POST data, use following url (same as used to GET).https://young-bayou-11361.herokuapp.com/topics
POST In Header: Content-Type = application/json Body: { "id": "Java", "name": "Java basics", "description": "Learn basic Java" }
-
To PUT/Modify/Update data of a topic, we need to send PUT request with payload contaning the same Id but modified data.
https://young-bayou-11361.herokuapp.com/topics/Java
PUT In Header: Content-Type = application/json Body: { "id": "Java", "name": "Java basics", "description": "Learn basic Java with example" }
If you notice, description element of Body, we see that it's been changed from
"description": "Learn basic Java" to "description": "Learn basic Java with example"
But id should remain same as before
"id:Java"
-
To DELETE a topic we need to send a DELETE request, with Id of the specific element. Here we are sending topic Id as
Java.