-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_routes.http
More file actions
97 lines (73 loc) · 1.98 KB
/
api_routes.http
File metadata and controls
97 lines (73 loc) · 1.98 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
################################################################################
# Test file for HTTP routes of the API
# Needs REST Client VSCode addon
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
################################################################################
@endpoint = http://localhost:{{$dotenv PORT}}/api
### 404
GET {{ endpoint }}/ofkjshsekih
#########################
# OBJECT1 #
#########################
### List of object1
GET {{ endpoint }}/myObjects1/
### Get object1 with id which does not exist
GET {{ endpoint }}/myObjects1/923
### Get object1 with id
GET {{ endpoint }}/myObjects1/2
### Insert object1 ERROR
POST {{ endpoint }}/myObjects1/
content-type: application/json
{
"title": null,
"content": "test insert ERROR",
"object2_id": 1
}
### Insert object1
POST {{ endpoint }}/myObjects1/
content-type: application/json
{
"title": "New test insert",
"content": "New test insert again",
"object2_id": 1
}
### Update object1
PATCH {{ endpoint }}/myObjects1/5
content-type: application/json
{
"title": "Change title of this object1",
"object2_id": 3
}
### Delete object1 with id
DELETE {{ endpoint }}/myObjects1/5
#########################
# OBJECT2 #
#########################
### List of object2
GET {{ endpoint }}/myObjects2/
### Get object2 with id which does not exist
GET {{ endpoint }}/myObjects2/923
### Get object2 with id
GET {{ endpoint }}/myObjects2/2
### Insert object2 ERROR
POST {{ endpoint }}/myObjects2/
content-type: application/json
{
"label": null,
"text_content": "test insert ERROR"
}
### Insert object2
POST {{ endpoint }}/myObjects2/
content-type: application/json
{
"label": "test insert object2",
"text_content": "New test insert of an object2"
}
### Update object2
PATCH {{ endpoint }}/myObjects2/3
content-type: application/json
{
"label": "Change title of this object2"
}
### Delete object2 with id
DELETE {{ endpoint }}/myObjects2/4