// Course.java public class Course { private long id; private String name; private String author; public Course(long id, String name, String author) { super(); this.id = id; this.name = name; this.author = author; } // getters .. setters ... @Override public String toString() { return "Course [id=" + id + ", name=" + name + ", author=" + author + "]"; } } // CourseController.java @RestController public class CourseController { @RequestMapping("/courses") // The data will be returned to this url public List<Course> retrieveAllCourses() { return Arrays.asList( new Course(1, "Learn AWS", "ashik"), new Course(2, "Learn DevOps", "amit"), new Course(3, "Learn Azure", "alex"), new Course(4, "Learn GCP", "vladimir") ); } }