Skip to content

Commit

Permalink
feat: add HTTP request files for Todo items and lists operations
Browse files Browse the repository at this point in the history
  • Loading branch information
nadirbad committed Dec 15, 2024
1 parent 653d4a0 commit bee7d50
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
38 changes: 38 additions & 0 deletions requests/TodoItems/CreateTodoItem.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@host = https://localhost:7098
@listId = 1

### Create Todo Item 1
POST {{host}}/api/todo-items
Content-Type: application/json

{
"listId": {{listId}},
"title": "Todo Item 1"
}

### Create Todo Item 2
POST {{host}}/api/todo-items
Content-Type: application/json

{
"listId": {{listId}},
"title": "Todo Item 2"
}

### Create Todo Item 3
POST {{host}}/api/todo-items
Content-Type: application/json

{
"listId": {{listId}},
"title": "Todo Item 3"
}

### Create Todo item with empty title. Check for 400 Bad Request
POST {{host}}/api/todo-items
Content-Type: application/json

{
"listId": {{listId}},
"title": ""
}
9 changes: 9 additions & 0 deletions requests/TodoItems/GetTodos.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@host = https://localhost:7098
@listId = 1

### Get Todo items with default pagination
GET {{host}}/api/todo-items?ListId={{listId}}
Content-Type: application/json

### Get Todo items with pagination, pageSize = 1, pageNumber = 2
GET {{host}}/api/todo-items?ListId={{listId}}&pageSize=1&pageNumber=2
22 changes: 22 additions & 0 deletions requests/TodoItems/UpdateTodoItem.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@host = https://localhost:7098
@itemId = 1

### Update Todo itemId = 1 with title = "Updated Todo Item 1" and done = true
PUT {{host}}/api/todo-items/{{itemId}}
Content-Type: application/json

{
"id": {{itemId}},
"title": "Updated Todo Item 1",
"done": true
}

### Update Todo itemId = 1 with wrong itemId. Check for 400 Bad Request
PUT {{host}}/api/todo-items/0
Content-Type: application/json

{
"id": {{itemId}},
"title": "Updated Todo Item 1",
"done": true
}
9 changes: 9 additions & 0 deletions requests/TodoLists/CreateTodoList.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@host = https://localhost:7098

### Create Todo List item
POST {{host}}/api/todo-lists
Content-Type: application/json

{
"title": "List 2"
}
4 changes: 4 additions & 0 deletions requests/TodoLists/GetTodoLists.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@host = https://localhost:7098

### Get Todo lists
GET {{host}}/api/todo-lists

0 comments on commit bee7d50

Please sign in to comment.