-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
44 lines (31 loc) · 1.32 KB
/
Copy pathrequests.http
File metadata and controls
44 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
### Create a new todo list
POST http://localhost:8080/lists
Content-Type: application/json
{ "name": "My new todo list" }
#### returns a 201 with the representation of the created list
### Fetch a todo list
GET http://localhost:8080/lists/{{id}}
Accept: application/json
#### returns a 200 with the representation of the list
#### returns a 404 if the list does not exist
### Fetch all todo lists
GET http://localhost:8080/lists
Accept: application/json
#### returns a 200 with the array of list representations
#### returns a 200 with an empty array if there are no lists
### Create a new todo for existing list
POST http://localhost:8080/lists/{{list-id}}/todos
Content-Type: application/json
{ "name": "My new todo item" }
#### returns a 201 with the representation of the created list
### Fetch a todo of existing list
GET http://localhost:8080/lists/{{list-id}}/todos/{{id}}
Accept: application/json
#### returns a 200 with the representation of the todo
#### returns a 404 if the todo does not exist
#### returns a 404 if the todo found does not match the list id provided
### Complete a todo of existing list
PUT http://localhost:8080/lists/{{list-id}}/todos/{{id}}/complete
#### returns a 204 with no content
#### returns a 404 if the todo does not exist
#### returns a 404 if the todo found does not match the list id provided