Skip to content

Commit ff36b8f

Browse files
committed
Add postman collection
1 parent f738d68 commit ff36b8f

File tree

1 file changed

+258
-0
lines changed

1 file changed

+258
-0
lines changed

Stub API.postman_collection.json

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
{
2+
"info": {
3+
"_postman_id": "877218d6-205c-4293-90e4-6f8b703e65aa",
4+
"name": "Stub API",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6+
"_exporter_id": "24753528"
7+
},
8+
"item": [
9+
{
10+
"name": "Clear all mocked data",
11+
"request": {
12+
"method": "POST",
13+
"header": [],
14+
"url": {
15+
"raw": "{{baseUrl}}/clear",
16+
"host": [
17+
"{{baseUrl}}"
18+
],
19+
"path": [
20+
"clear"
21+
]
22+
}
23+
},
24+
"response": [
25+
{
26+
"name": "Successful response",
27+
"originalRequest": {
28+
"method": "POST",
29+
"header": [],
30+
"url": {
31+
"raw": "{{baseUrl}}/clear",
32+
"host": [
33+
"{{baseUrl}}"
34+
],
35+
"path": [
36+
"clear"
37+
]
38+
}
39+
},
40+
"status": "OK",
41+
"code": 200,
42+
"_postman_previewlanguage": "json",
43+
"header": [
44+
{
45+
"key": "Content-Type",
46+
"value": "application/json; charset=UTF-8"
47+
},
48+
{
49+
"key": "Date",
50+
"value": "Fri, 26 Jan 2024 10:02:15 GMT"
51+
},
52+
{
53+
"key": "Content-Length",
54+
"value": "17"
55+
}
56+
],
57+
"cookie": [],
58+
"body": "{\n \"cookie\": \"doan\"\n}"
59+
}
60+
]
61+
},
62+
{
63+
"name": "Example request",
64+
"request": {
65+
"method": "GET",
66+
"header": [],
67+
"url": {
68+
"raw": "{{baseUrl}}/api/sample",
69+
"host": [
70+
"{{baseUrl}}"
71+
],
72+
"path": [
73+
"api",
74+
"sample"
75+
]
76+
}
77+
},
78+
"response": [
79+
{
80+
"name": "No data response",
81+
"originalRequest": {
82+
"method": "GET",
83+
"header": [],
84+
"url": {
85+
"raw": "{{baseUrl}}/api/sample",
86+
"host": [
87+
"{{baseUrl}}"
88+
],
89+
"path": [
90+
"api",
91+
"sample"
92+
]
93+
}
94+
},
95+
"status": "OK",
96+
"code": 200,
97+
"_postman_previewlanguage": "json",
98+
"header": [
99+
{
100+
"key": "Content-Type",
101+
"value": "application/json; charset=UTF-8"
102+
},
103+
{
104+
"key": "Date",
105+
"value": "Fri, 26 Jan 2024 10:02:42 GMT"
106+
},
107+
{
108+
"key": "Content-Length",
109+
"value": "2"
110+
}
111+
],
112+
"cookie": [],
113+
"body": "{}"
114+
},
115+
{
116+
"name": "Successful response",
117+
"originalRequest": {
118+
"method": "GET",
119+
"header": [],
120+
"url": {
121+
"raw": "{{baseUrl}}/api/sample",
122+
"host": [
123+
"{{baseUrl}}"
124+
],
125+
"path": [
126+
"api",
127+
"sample"
128+
]
129+
}
130+
},
131+
"status": "OK",
132+
"code": 200,
133+
"_postman_previewlanguage": "json",
134+
"header": [
135+
{
136+
"key": "Content-Type",
137+
"value": "application/json; charset=UTF-8"
138+
},
139+
{
140+
"key": "Date",
141+
"value": "Fri, 26 Jan 2024 10:03:21 GMT"
142+
},
143+
{
144+
"key": "Content-Length",
145+
"value": "17"
146+
}
147+
],
148+
"cookie": [],
149+
"body": "{\n \"hello\": \"world\"\n}"
150+
}
151+
]
152+
},
153+
{
154+
"name": "Create mock data",
155+
"request": {
156+
"method": "POST",
157+
"header": [],
158+
"body": {
159+
"mode": "raw",
160+
"raw": "{\n // request method\n \"method\": \"GET\",\n // requset path, which place right after baseUrl/api/\n \"path\": \"/sample\", \n // response body\n \"data\": {\n \"hello\": \"world\"\n },\n // response status\n \"status\": 200\n}",
161+
"options": {
162+
"raw": {
163+
"language": "json"
164+
}
165+
}
166+
},
167+
"url": {
168+
"raw": "{{baseUrl}}/create",
169+
"host": [
170+
"{{baseUrl}}"
171+
],
172+
"path": [
173+
"create"
174+
]
175+
}
176+
},
177+
"response": [
178+
{
179+
"name": "Successful response",
180+
"originalRequest": {
181+
"method": "POST",
182+
"header": [],
183+
"body": {
184+
"mode": "raw",
185+
"raw": "{\n // request method\n \"method\": \"GET\",\n // requset path, which place right after baseUrl/api/\n \"path\": \"/sample\", \n // response body\n \"data\": {\n \"hello\": \"world\"\n },\n // response status\n \"status\": 200\n}",
186+
"options": {
187+
"raw": {
188+
"language": "json"
189+
}
190+
}
191+
},
192+
"url": {
193+
"raw": "{{baseUrl}}/create",
194+
"host": [
195+
"{{baseUrl}}"
196+
],
197+
"path": [
198+
"create"
199+
]
200+
}
201+
},
202+
"status": "OK",
203+
"code": 200,
204+
"_postman_previewlanguage": "json",
205+
"header": [
206+
{
207+
"key": "Content-Type",
208+
"value": "application/json; charset=UTF-8"
209+
},
210+
{
211+
"key": "Date",
212+
"value": "Fri, 26 Jan 2024 10:01:45 GMT"
213+
},
214+
{
215+
"key": "Content-Length",
216+
"value": "85"
217+
}
218+
],
219+
"cookie": [],
220+
"body": "{\n \"user\": \"doan\",\n \"method\": \"GET\",\n \"path\": \"/sample\",\n \"data\": {\n \"hello\": \"world\"\n },\n \"status\": 200\n}"
221+
}
222+
]
223+
}
224+
],
225+
"event": [
226+
{
227+
"listen": "prerequest",
228+
"script": {
229+
"type": "text/javascript",
230+
"exec": [
231+
""
232+
]
233+
}
234+
},
235+
{
236+
"listen": "test",
237+
"script": {
238+
"type": "text/javascript",
239+
"exec": [
240+
""
241+
]
242+
}
243+
}
244+
],
245+
"variable": [
246+
{
247+
"key": "baseUrl",
248+
"value": "http://localhost:3000",
249+
"type": "string"
250+
},
251+
{
252+
"key": "userId",
253+
"value": "someone",
254+
"type": "string",
255+
"disabled": true
256+
}
257+
]
258+
}

0 commit comments

Comments
 (0)