-
Notifications
You must be signed in to change notification settings - Fork 0
/
restClient.http
78 lines (59 loc) · 2.43 KB
/
restClient.http
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@entryPoint = http://localhost:4101/api/v1
GET {{entryPoint}}
# // ------------------------------
# // ---------------------- ARTICLE
# // ------------------------------
### FETCH ALL ARTICLES ( GET /post )
GET {{entryPoint}}/posts
### POST ONE ARTICLES ( POST /post )
POST {{entryPoint}}/posts
Content-Type: application/json
{
"category":"React",
"slug":"react-une-fausse-bonne-idee",
"title":"React une fausseb bonne idee",
"excerpt":"Ut enim ad <em>minim veniam</em>, quis nostrud exercitation ullamco <strong>laboris nisi</strong> ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et <em>dolore magna</em> aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fu",
"content":"sectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Ut enim ad minim veniam, quis nostrud exer",
"category_id":3
}
### FETCH ONE ARTICLE ( GET /post/[:id] )
# Nos tests :
# GET {{entryPoint}}/posts/"2"
# GET {{entryPoint}}/posts/blablab
# GET {{entryPoint}}/posts/200
GET {{entryPoint}}/posts/9
### PATCH ONE ARTICLE ( PATCH /post/[:id] )
PATCH {{entryPoint}}/posts/15
Content-Type: application/json
{
"category":"Reactoooooo",
"slug":"react-une-fausse-bonne-idee",
"title":"React une fausseb bonne idee"
}
### DELETE ONE ARTICLE ( DELETE /post/[:id] )
DELETE {{entryPoint}}/posts/14
# // ------------------------------
# // --------------------- CATEGORY
# // ------------------------------
### FETCH ARTICLES BY CATEGORY ID ( GET /post/category/[:id] )
GET {{entryPoint}}/posts/category/3
### FETCH ALL CATEGORIES ( GET /categories )
GET {{entryPoint}}/categories
### POST ONE GATEGORY ( POST /categories )
POST {{entryPoint}}/categories
Content-Type: application/json
{
"route": "/newRoute",
"label": "newLabel"
}
### FETCH ONE GATEGORY ( GET /categories/[:id] )
GET {{entryPoint}}/categories/1
### PATCH ONE GATEGORY ( PATCH /categories/[:id] )
PATCH {{entryPoint}}/categories/6
Content-Type: application/json
{
"route": "/newRouteModified",
"label": "newLabel"
}
### DELETE ONE GATEGORY ( DELETE /categories/[:id] )
DELETE {{entryPoint}}/categories/6