Enhancement: Add requestBody param for customapi (#2921)

This commit is contained in:
Derek Stotz authored and GitHub committed 2024-02-16 20:25:31 -08:00
1 parent 0d47dcaac7
commit c268739e1f
2 files changed
+20

No files matched your search

+6
View File
@@ -35,6 +35,12 @@ export default async function genericProxyHandler(req, res, map) {
};
if (req.body) {
params.body = req.body;
} else if (widget.requestBody) {
if (typeof widget.requestBody === "object") {
params.body = JSON.stringify(widget.requestBody);
} else {
params.body = widget.requestBody;
}
}
const [status, contentType, data] = await httpProxy(url, params);