-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-note.txt
53 lines (37 loc) · 1.57 KB
/
test-note.txt
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
45
46
47
48
49
50
51
52
53
export
curl -X GET http://localhost:8080/api/toys/export | json_pp
----------------
list
curl -X GET http://localhost:8080/api/toys \
-H 'Content-Type: application/json' | json_pp
----------------
create
not valid
curl -X POST http://localhost:8080/api/toys \
-H "Content-Type: application/json" -d "{\"name\":\"test\",\"content\":\"zz\"}" | json_pp
valid
curl -X POST http://localhost:8080/api/toys \
-H "Content-Type: application/json" -d "{\"name\":\"test\",\"image\":\"zz\"}" | json_pp
curl -X POST http://localhost:8080/api/toys \
-H "Content-Type: application/json" -d "{\"name\":\"test\",\"image\":\"zz\",\"likes\":200}" | json_pp
----------------
update
not valid
curl -X POST http://localhost:8080/api/toys/1 \
-H "Content-Type: application/json" -d "{\"name\":\"test\",\"content\":\"zz\"}" | json_pp
valid
curl -X POST http://localhost:8080/api/toys/1 \
-H "Content-Type: application/json" -d "{\"name\":\"test1\",\"image\":\"test\"}" | json_pp
curl -X PATCH http://localhost:8080/api/toys/1 \
-H "Content-Type: application/json" -d "{\"name\":\"test3\",\"image\":\"test2\",\"likes\":2000}" | json_pp
----------------
likes
not valid
curl -X POST http://localhost:8080/api/toys/1/likes \
-H "Content-Type: application/json" -d "{\"name\":\"test\",\"content\":\"zz\"}" | json_pp
valid
curl -X POST http://localhost:8080/api/toys/1/likes \
-H "Content-Type: application/json" -d "{\"likes\":\"3\",\"image\":\"test\"}" | json_pp
curl -X PUT http://localhost:8080/api/toys/1/likes \
-H "Content-Type: application/json" -d "{\"likes\":2030}" | json_pp
----------------