-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
108 lines (98 loc) · 4.55 KB
/
index.html
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
<!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">
<script src="script.js" type="module"></script>
<title>Postman Clone</title>
</head>
<body>
<div class="p-4">
<form data-form>
<div class="input-group mb-4">
<select class="form-select flex-grow-0 w-auto" data-method>
<option value="GET" selected>GET</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="PATCH">PATCH</option>
<option value="DELETE">DELETE</option>
</select>
<input data-url required class="form-control" type="url" placeholder="https://example.com" />
<button type="submit" class="btn btn-primary">Send</button>
</div>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="query-params-tab" data-bs-toggle="tab" data-bs-target="#query-params"
type="button" role="tab" aria-controls="query-params" aria-selected="true">Query Params</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="request-headers-tab" data-bs-toggle="tab" data-bs-target="#request-headers"
type="button" role="tab" aria-controls="request-headers" aria-selected="false">Headers</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="json-tab" data-bs-toggle="tab" data-bs-target="#json" type="button" role="tab"
aria-controls="json" aria-selected="false">JSON</button>
</li>
</ul>
<!-- Workinf for contents -->
<div class="tab-content p-3 border-top-0 border">
<div class="tab-pane fade show active" id="query-params" role="tabpanel" aria-labelledby="query-params-tab">
<div data-query-params></div>
<button data-add-query-param-btn class="mt-2 btn btn-outline-success" type="button">Add</button>
</div>
<div class="tab-pane fade" id="request-headers" role="tabpanel" aria-labelledby="request-headers-tab">
<div data-request-headers></div>
<button data-add-request-header-btn class="mt-2 btn btn-outline-success" type="button">Add</button>
</div>
<div class="tab-pane fade" id="json" role="tabpanel" aria-labelledby="json-tab">
<div data-json-request-body class="overflow-auto" style="max-height: 200px;"></div>
</div>
</div>
</form>
<!-- Response HTML -->
<div class="mt-5 d-none" data-response-section>
<h3>Response</h3>
<div class="d-flex my-2">
<div class="me-3">
Status: <span data-status></span>
</div>
<div class="me-3">
Time: <span data-time></span>ms
</div>
<div class="me-3">
Size: <span data-size></span>
</div>
</div>
<ul class="nav nav-tabs" role="tablist">
<!-- for body -->
<li class="nav-item" role="presentation">
<button class="nav-link active" id="body-tab" data-bs-toggle="tab" data-bs-target="#body" type="button"
role="tab" aria-controls="body" aria-selected="true">Body</button>
</li>
<!-- for Headers -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="response-headers-tab" data-bs-toggle="tab" data-bs-target="#response-headers"
type="button" role="tab" aria-controls="response-headers" aria-selected="false">Headers</button>
</li>
</ul>
<div class="tab-content p-3 border-top-0 border">
<div class="tab-pane fade show active" id="body" role="tabpanel" aria-labelledby="body-tab">
<div data-json-response-body class="overflow-auto" style="max-height: 200px;"></div>
</div>
<div class="tab-pane fade" id="response-headers" role="tabpanel" aria-labelledby="response-headers-tab">
<div style="display: grid; grid-template-columns: auto 1fr; gap: .5rem 2rem;" data-response-headers></div>
</div>
</div>
</div>
</div>
<!-- template for query params -->
<template data-key-value-template>
<div class="input-group my-2" data-key-value-pair>
<input type="text" data-key class="form-control" placeholder="Key" />
<input type="text" data-value class="form-control" placeholder="Value" />
<button type="button" data-remove-btn class="btn btn-outline-danger">Remove</button>
</div>
</template>
</body>
</html>