@kaoshihchuan said in Duet Web control for rr_"commands":
@stuartofmt
Do I have the right format for the code I sent?
I'm not the best to ask on this as my projects so far have been "blind" as it relates to sending gcode to an SBC. I have relied on others to report back any issues.
Ultimately - when GET is used , all parameters end up being encoded into the URL as query string parameters. With POST, the data is in the message body.
My GUESS would be that the correct form is something like this:
command = 'G0 X300 Y300'
r = requests.post('http://192.168.168.144/machine/code', data=command)
or maybe with
command = {'gcode':'G0 X300 Y300'}
Edit: Please let me know what works as I have a bit of POST code in one of my Duet related projects and I'm not sure if it works or not π