diff --git a/server/model/monitor.js b/server/model/monitor.js index 09d0f2b55..85d98d181 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -431,6 +431,9 @@ class Monitor extends BeanModel { } catch (e) { throw new Error("Your JSON body is invalid. " + e.message); } + } else if (this.httpBodyEncoding === "form") { + bodyValue = this.body; + contentType = "application/x-www-form-urlencoded"; } else if (this.httpBodyEncoding === "xml") { bodyValue = this.body; contentType = "text/xml; charset=utf-8"; diff --git a/server/server.js b/server/server.js index 2cf616a9d..5bded809b 100644 --- a/server/server.js +++ b/server/server.js @@ -251,6 +251,12 @@ let needSetup = false; log.debug("test", request.body); response.send("OK"); }); + + app.post("/test-x-www-form-urlencoded", async (request, response) => { + log.debug("test", request.headers); + log.debug("test", request.body); + response.send("OK"); + }); } // Robots.txt diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index c8b166637..f59a2d573 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -654,6 +654,7 @@ @@ -1002,6 +1003,9 @@ message HealthCheckResponse { ` ]); } + if (this.monitor && this.monitor.httpBodyEncoding === "form") { + return this.$t("Example:", [ "key1=value1&key2=value2" ]); + } return this.$t("Example:", [ ` { "key": "value"