-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCurl test for API
32 lines (22 loc) · 1.19 KB
/
Curl test for API
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
--logs in as given username/password
curl --data "userName=caiyo&password=poop" -c "cookies.txt" http://localhost:9000/login
--create group, given name, of logged in person
curl -b "cookies.txt" --data "name=newgroup" http://localhost:9000/api/groups
--get all groups of logged in member
curl -b "cookies.txt" http://localhost:9000/api/groups
--add user to group
curl -b "cookies.txt" --data "username=kyle&isAdmin=true" http://localhost:9000/api/groups/1?action=addUser
--remove user from group
curl -b "cookies.txt" --data "username=kyle" http://localhost:9000/api/groups/1?action=removeUser
--promote user to admin
curl -b "cookies.txt" --data "username=kyle" http://localhost:9000/api/groups/1?action=promoteUser
--create list
curl -b "cookies.txt" --data "name=list1&p1=price&p2=duedate&p3=amount&req_p3=req" http://localhost:9000/api/groups/1/lists
--delete list
curl -b "cookies.txt" -X DELETE http://localhost:9000/api/lists/2
--add item
curl -b "cookies.txt" --data "name=item2&Qty=10" http://localhost:9000/api/lists/6
--delete item
curl -b "cookies.txt" -X DELETE http://localhost:9000/api/lists/3/item/1
--checkoff item
curl -b "cookies.txt" -X PUT http://localhost:9000/api/lists/8/item/20/checkoff