Skip to content

Commit

Permalink
添加GCode选项,读取gdoce script,直接替代body
Browse files Browse the repository at this point in the history
  • Loading branch information
G authored and G committed Oct 31, 2024
1 parent 0d93341 commit d5a3f10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions klippy/extras/request_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d5a3f10

Please sign in to comment.