-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-client.html
More file actions
239 lines (227 loc) · 8.05 KB
/
Copy pathapi-client.html
File metadata and controls
239 lines (227 loc) · 8.05 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DevKit Studio | API Client</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
</head>
<body data-page="api-client">
<div class="app-shell">
<aside class="sidebar">
<a class="brand" href="index.html" aria-label="DevKit Studio dashboard">
<div class="brand-mark">DS</div>
<div>
<h1 class="brand-title">DevKit Studio</h1>
<p class="brand-subtitle">VS Code meets Postman in the browser</p>
</div>
</a>
<p class="sidebar-label">Workspace Modules</p>
<nav class="module-nav" aria-label="DevKit modules">
<a class="module-link" href="index.html" data-page-link="index"
><span>Dashboard</span><span class="module-index">00</span></a
>
<a
class="module-link"
href="json-explorer.html"
data-page-link="json-explorer"
><span>JSON Explorer</span><span class="module-index">01</span></a
>
<a
class="module-link"
href="xml-explorer.html"
data-page-link="xml-explorer"
><span>XML Explorer</span><span class="module-index">02</span></a
>
<a
class="module-link"
href="rss-reader.html"
data-page-link="rss-reader"
><span>RSS Reader</span><span class="module-index">03</span></a
>
<a
class="module-link"
href="api-client.html"
data-page-link="api-client"
><span>API Client</span><span class="module-index">04</span></a
>
<a
class="module-link"
href="response-comparator.html"
data-page-link="response-comparator"
><span>Response Comparator</span
><span class="module-index">05</span></a
>
<a
class="module-link"
href="schema-builder.html"
data-page-link="schema-builder"
><span>Schema Builder</span><span class="module-index">06</span></a
>
<a
class="module-link"
href="json-xml-converter.html"
data-page-link="json-xml-converter"
><span>JSON ↔ XML Converter</span
><span class="module-index">07</span></a
>
<a
class="module-link"
href="api-viewer.html"
data-page-link="api-viewer"
><span>API Viewer</span><span class="module-index">08</span></a
>
<a
class="module-link"
href="request-history.html"
data-page-link="request-history"
><span>Request History</span><span class="module-index">09</span></a
>
<a
class="module-link"
href="collections.html"
data-page-link="collections"
><span>Collections</span><span class="module-index">10</span></a
>
<a
class="module-link"
href="environment-variables.html"
data-page-link="environment-variables"
><span>Environment Variables</span
><span class="module-index">11</span></a
>
<a
class="module-link"
href="mock-response-generator.html"
data-page-link="mock-response-generator"
><span>Mock Response Generator</span
><span class="module-index">12</span></a
>
</nav>
<p class="footer-note">Local-first developer tooling workspace</p>
</aside>
<main class="main-shell">
<header class="page-header">
<p class="page-kicker">Module 04</p>
<h2 class="page-title">API Client</h2>
<p class="page-subtitle">
Send GET, POST, PUT, and DELETE requests with headers, query params,
JSON bodies, environments, history, and collections.
</p>
</header>
<section class="status-bar" aria-live="polite">
<p class="status-message" id="globalStatus">
API Client ready. Load a sample request or enter a URL.
</p>
<span class="status-chip">HTTP</span>
</section>
<section class="module-grid">
<div class="panel">
<div class="api-url-row">
<select class="form-select" id="apiMethod">
<option>GET</option>
<option>POST</option>
<option>PUT</option>
<option>DELETE</option>
</select>
<input
class="form-control"
id="apiUrl"
type="url"
placeholder="https://jsonplaceholder.typicode.com/posts or {{baseUrl}}/posts"
/>
</div>
<div class="toolbar">
<button class="btn btn-cyber" type="button" id="sendApiBtn">
Send Request
</button>
<button
class="btn btn-purple"
type="button"
id="loadSampleRequestBtn"
>
Load Sample Request
</button>
<button class="btn btn-ghost" type="button" id="saveRequestBtn">
Save Request
</button>
<button class="btn btn-ghost" type="button" id="copyResponseBtn">
Copy Response
</button>
<button
class="btn btn-ghost"
type="button"
id="downloadResponseBtn"
>
Download Response
</button>
</div>
<div class="panel-header">
<h3 class="panel-title">Headers</h3>
<button
class="btn btn-sm btn-ghost"
type="button"
id="addHeaderBtn"
>
Add Header
</button>
</div>
<div id="headersEditor"></div>
<div class="panel-header mt-3">
<h3 class="panel-title">Query Parameters</h3>
<button
class="btn btn-sm btn-ghost"
type="button"
id="addQueryBtn"
>
Add Param
</button>
</div>
<div id="queryEditor"></div>
<label class="form-label mt-3" for="apiBody">JSON Body</label>
<textarea
class="code-input form-control"
id="apiBody"
spellcheck="false"
placeholder="{ }"
></textarea>
</div>
<div class="panel">
<div class="pill-row mb-3" id="responseStats">
<span class="stat-pill">Status: -</span>
<span class="stat-pill">Time: -</span>
<span class="stat-pill">Size: -</span>
<span class="stat-pill">Type: -</span>
</div>
<div class="response-tabs">
<button
class="tab-button active"
type="button"
data-response-tab="pretty"
>
Pretty
</button>
<button class="tab-button" type="button" data-response-tab="raw">
Raw
</button>
</div>
<pre class="code-output" id="responsePretty">
Send a request to view the response.</pre
>
<pre class="code-output d-none" id="responseRaw">
Send a request to view the raw response.</pre
>
</div>
</section>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="js/shared.js"></script>
<script src="js/api-client.js"></script>
</body>
</html>