-
Notifications
You must be signed in to change notification settings - Fork 0
/
CURLs.txt
34 lines (18 loc) · 1.07 KB
/
CURLs.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
General GET:
curl -v localhost/v1/recipes
GET:
curl -v localhost/v1/recipes/1
POST (Create):
curl -v -H "Content-Type: application/json" -d '{"name":"test recipe","preptime":1.11,"difficulty":1,"vegetarian":false}' localhost/v1/recipes
curl -v -H "Content-Type: application/json" -d '{"name":"test recipe 2","preptime":1.22,"difficulty":2,"vegetarian":true}' localhost/v1/recipes
PUT (Update):
curl -v -X PUT -H "Content-Type: application/json" -d '{"name":"test recipe updated - put","preptime":1.3,"difficulty":2,"vegetarian":true}' localhost/v1/recipes/1
PATCH (Update):
curl -v -X PATCH -H "Content-Type: application/json" -d '{"name":"test recipe 2 updated - patch","preptime":1.5,"difficulty":3,"vegetarian":false}' localhost/v1/recipes/2
DELETE:
curl -v -X DELETE -H "Content-Type: application/json" localhost/v1/recipes/1
RATE:
curl -v -H "Content-Type: application/json" -d '{"rating":3}' localhost/v1/recipes/1/rating
SEARCH:
curl -v -F count=5 -F start=1 -F preptime=0.5 localhost/v1/recipes/search
curl -v -F preptime=0.5 localhost/v1/recipes/search