http://<your_server_host>:<port_number>
For example: http://localhost:8080
Returns a simple greeting message.
- No parameters required.
- 200 OK:
Hello
Retrieves a list of all tasks.
- No parameters required.
- 200 OK: List of tasks
[ { "id": 1, "title": "Sample Task", "description": "This is a sample task", "completed": false }, ... ]
Fetches a task by its unique identifier.
id(long) - The ID of the task.
- 200 OK: Task details
{ "id": 1, "title": "Sample Task", "description": "This is a sample task", "completed": false } - 404 Not Found: Task not found
Adds a new task to the list.
{
"title": "New Task",
"description": "Task details",
"completed": false
}- 201 Created: Task successfully added
{ "id": 2, "title": "New Task", "description": "Task details", "completed": false } - 400 Bad Request: Error while adding the task
Updates an existing task by its ID.
id(long) - The ID of the task to be updated.
{
"title": "Updated Task",
"description": "Updated details",
"completed": true
}- 200 OK: Task successfully updated
{ "id": 2, "title": "Updated Task", "description": "Updated details", "completed": true } - 404 Not Found: Task not found
Deletes a task by its unique identifier.
id(long) - The ID of the task to delete.
- 200 OK: Task successfully deleted
- 404 Not Found: Task not found
- Ensure that
@CrossOriginannotation is used if accessing the API from a frontend client hosted on a different origin. - For Postman testing, create a collection and add these endpoints with proper configurations.
- Use
Content-Type: application/jsonfor POST and PUT requests.
Let me know if you need a sample Postman collection JSON export for this API.
yes