+
HTTP CLIENT
+
+
+
+ setUrl(e.target.value)}
+ placeholder="https://api.example.com/resource"
+ style={{ ...inputStyle, flex: 1 }}
+ />
+
+
+
+
Headers
+ {headers.map((row, i) => (
+
+ updateHeader(i, "key", e.target.value)}
+ placeholder="Header"
+ style={{ ...inputStyle, flex: 1 }}
+ />
+ updateHeader(i, "value", e.target.value)}
+ placeholder="Value"
+ style={{ ...inputStyle, flex: 1 }}
+ />
+ {i < headers.length - 1 && (
+
+ )}
+
+ ))}
+
+
+ {HAS_BODY[method] && (
+
+ Body
+
+ )}
+
+
+
+ {error && (
+
{error}
+ )}
+
+ {response && (
+
+
+ {response.status}
+
+
+
+ Response headers ({Object.keys(response.headers).length})
+
+ {Object.entries(response.headers).map(([k, v]) => `${k}: ${v}`).join("\n")}
+
+
+
+ {prettyBody(response.body)}
+
+
+ )}
+
+ {history.length > 0 && (
+
+ History
+ {history.map((entry) => (
+
+ ))}
+
+ )}
+
+ );
+}
diff --git a/plugins/http-client/src/activate.ts b/plugins/http-client/src/activate.ts
new file mode 100644
index 0000000..056590f
--- /dev/null
+++ b/plugins/http-client/src/activate.ts
@@ -0,0 +1,64 @@
+import { HttpClientPanel } from "./HttpClientPanel";
+
+// Hermes Plugin API types (provided at runtime by the host app)
+interface Disposable {
+ dispose(): void;
+}
+
+interface PluginPanelProps {
+ pluginId: string;
+ panelId: string;
+}
+
+export interface HermesPluginAPI {
+ ui: {
+ registerPanel(panelId: string, component: React.ComponentType