From d5a3f109a198d15aa1e5bebe41e596aed56f1896 Mon Sep 17 00:00:00 2001 From: G Date: Fri, 1 Nov 2024 01:11:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0GCode=E9=80=89=E9=A1=B9,?= =?UTF-8?q?=E8=AF=BB=E5=8F=96gdoce=20script,=E7=9B=B4=E6=8E=A5=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3body?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klippy/extras/request_url.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/klippy/extras/request_url.py b/klippy/extras/request_url.py index 4855464627a5..395bdcf9798c 100644 --- a/klippy/extras/request_url.py +++ b/klippy/extras/request_url.py @@ -125,6 +125,9 @@ def cmd_HTTP_REQUEST(self, gcmd): self.method = gcmd.get("METHOD", self.method) self.url = gcmd.get("URL", self.url) self.body = gcmd.get("BODY", self.body) + gcode_script = gcmd.get("GCODE", None) + if gcode_script is not None: + self.body = '{"script": "%s"}' % gcode_script self.headers = gcmd.get("HEADERS", self.headers) self.repeat = gcmd.get_float('REPEAT', self.repeat) self.isloginfo = gcmd.get_int('LOG', self.isloginfo)