-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
326 lines (322 loc) · 12.6 KB
/
index.html
File metadata and controls
326 lines (322 loc) · 12.6 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css"
/>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
<link rel="stylesheet" href="styles.css" />
<title>Postman Lite</title>
</head>
<body>
<div class="container">
<div class="container-lg px-3 mx-auto">
<h2 class="text-center mt-1">Postman Lite</h2>
<div class="row flex-wrap">
<div class="col" style="min-height: 580px;">
<h3 class="mt-1">Request</h3>
<div class="input-group mb-3">
<select
id="requestMethod"
class="input-group-text form-select"
>
<option>GET</option>
<option>POST</option>
<option>PUT</option>
<option>PATCH</option>
<option>DELETE</option>
</select>
<input
id="requestUrl"
type="text"
class="form-control"
placeholder="https://api.example.com/v1/users"
title="Enter a valid URL (e.g., https://api.example.com/v1/users)"
/>
<small class="form-text text-muted url-hint" style="display: none; padding: 5px 0 0 5px; font-size: 12px;">
Example: https://jsonplaceholder.typicode.com/posts
</small>
<span class="input-group-text btn btn-success" id="sendRequest">
Send
</span>
</div>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button
class="nav-link active"
id="query-tab"
data-bs-toggle="tab"
data-bs-target="#query"
type="button"
role="tab"
aria-controls="query"
aria-selected="true"
>
Query
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="auth-tab"
data-bs-toggle="tab"
data-bs-target="#auth"
type="button"
role="tab"
aria-controls="auth"
aria-selected="false"
>
Auth
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="headers-tab"
data-bs-toggle="tab"
data-bs-target="#headers"
type="button"
role="tab"
aria-controls="headers"
aria-selected="false"
>
Headers
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="body-tab"
data-bs-toggle="tab"
data-bs-target="#body"
type="button"
role="tab"
aria-controls="body"
aria-selected="false"
>
Body
</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div
class="tab-pane fade show active"
id="query"
role="tabpanel"
aria-labelledby="query-tab"
>
<h5 class="my-3">Query Parameters</h5>
<ul class="list-group" id="queryParametersList">
<li class="list-group-item d-flex">
<input
class="me-2"
type="checkbox"
/>
<input
class="form-control me-1"
type="text"
placeholder="key (e.g., page)"
title="Query parameter key"
/>
<input
class="form-control ms-1"
type="text"
placeholder="value (e.g., 1)"
title="Query parameter value"
/>
</li>
<li class="list-group-item d-flex">
<button
class="btn btn-primary ms-auto"
id="addQueryParameters"
>
Add
</button>
</li>
</ul>
</div>
<div
class="tab-pane fade"
id="auth"
role="tabpanel"
aria-labelledby="auth-tab"
>
<h5 class="my-3">Authorization</h5>
<select id="requestAuth" class="form-select mb-2">
<option value="none">None</option>
<option value="basic-auth">Basic Auth</option>
<option value="bearer-token">Bearer Token</option>
</select>
<div class="visually-hidden auth-methods" id="basic-auth">
<input
id="basicAuthUsername"
type="text"
class="form-control mb-2"
placeholder="Username"
title="Enter your username for Basic Authentication"
/>
<small class="form-text text-muted mb-2" style="display: block; font-size: 12px; margin-top: -8px; margin-bottom: 8px !important;">
Example: admin, user, api_user
</small>
<input
id="basicAuthPassword"
type="password"
class="form-control"
placeholder="Password"
title="Enter your password for Basic Authentication"
/>
<small class="form-text text-muted" style="display: block; font-size: 12px; margin-top: 5px;">
Your password will be encoded in Base64
</small>
</div>
<div class="visually-hidden auth-methods" id="bearer-token">
<input
id="bearerToken"
type="text"
class="form-control"
placeholder="Enter your Bearer token"
title="Enter your Bearer token (without 'Bearer' prefix)"
/>
<small class="form-text text-muted" style="display: block; font-size: 12px; margin-top: 5px;">
Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
</small>
<small class="form-text text-muted" style="display: block; font-size: 11px; margin-top: 3px; color: #718096;">
Note: The "Bearer" prefix will be added automatically
</small>
</div>
</div>
<div
class="tab-pane fade"
id="headers"
role="tabpanel"
aria-labelledby="headers-tab"
>
<h5 class="my-3">HTTP Headers</h5>
<ul class="list-group" id="headersList">
<li class="list-group-item d-flex">
<input
class="me-2"
type="checkbox"
/>
<input
class="form-control me-1"
type="text"
placeholder="Header name (e.g., Content-Type)"
title="HTTP header name"
/>
<input
class="form-control ms-1"
type="text"
placeholder="Header value (e.g., application/json)"
title="HTTP header value"
/>
</li>
<li class="list-group-item d-flex">
<button class="btn btn-primary ms-auto" id="addHeaders">
Add
</button>
</li>
</ul>
</div>
<div
class="tab-pane fade"
id="body"
role="tabpanel"
aria-labelledby="body-tab"
>
<select id="requestBodyType" class="form-select mt-3 mb-2">
<option value="none">Empty</option>
<option value="application-json">JSON</option>
<option value="text-plain">Text</option>
<option value="application-xml">XML</option>
</select>
<div class="visually-hidden body-types" id="application-json">
<textarea
id="application-json-data"
type="text"
class="form-control"
placeholder='{\n "key": "value",\n "name": "example"\n}'
title="Enter valid JSON data"
></textarea>
<small class="form-text text-muted" style="display: block; font-size: 12px; margin-top: 5px;">
Enter valid JSON format. Example: {"name": "John", "age": 30}
</small>
</div>
<div class="visually-hidden body-types" id="text-plain">
<textarea
id="text-plain-data"
type="text"
class="form-control"
placeholder="Enter plain text here..."
title="Enter plain text data"
></textarea>
<small class="form-text text-muted" style="display: block; font-size: 12px; margin-top: 5px;">
Enter any plain text content
</small>
</div>
<div class="visually-hidden body-types" id="application-xml">
<textarea
id="application-xml-data"
type="text"
class="form-control"
placeholder='<?xml version="1.0"?>\n<root>\n <item>value</item>\n</root>'
title="Enter valid XML data"
></textarea>
<small class="form-text text-muted" style="display: block; font-size: 12px; margin-top: 5px;">
Enter valid XML format. Example: <root><item>value</item></root>
</small>
</div>
</div>
</div>
</div>
<div class="col" style="min-height: 580px;">
<h3 class="mt-1">Response</h3>
<div class="response-info">
<div>
<span>Status:</span>
<span id="responseStatus">-</span>
</div>
<div>
<span>Size:</span>
<span id="responseSize">-</span>
</div>
<div>
<span>Time:</span>
<span id="responseTime">-</span>
</div>
</div>
<div class="response-container">
<pre>
<code id="responseText" class="language-json"></code>
</pre>
</div>
</div>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>
<script src="src/index.js"></script>
<script>
// Initialize Highlight.js after page load
document.addEventListener("DOMContentLoaded", function() {
if (typeof hljs !== "undefined") {
hljs.highlightAll();
}
});
</script>
</body>
</html>