From 2b7885c3f8738eeee34c5778b0b81fbccb1139fc Mon Sep 17 00:00:00 2001 From: bortek Date: Tue, 30 Dec 2014 12:18:39 +0100 Subject: [PATCH] Update printer.rst --- docs/api/printer.rst | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/api/printer.rst b/docs/api/printer.rst index a39c5121..9ba1ab62 100644 --- a/docs/api/printer.rst +++ b/docs/api/printer.rst @@ -331,7 +331,7 @@ Retrieve the current SD state GET /api/printer/sd HTTP/1.1 Host: example.com - **Example Response** + **ponse** .. sourcecode:: http @@ -345,6 +345,33 @@ Retrieve the current SD state :statuscode 200: No error :statuscode 404: If SD support has been disabled in OctoPrint's config. +.. _sec-api-printer-arbcommand: + +Send an arbitrary command to the printer +============================= + +.. http:post:: /api/printer/command + + Sends any command to the printer via serial inerface. Should be used with some care as some commands can stop a running print job. + + If successful returns a :http:statuscode:`204` and an empty body. + + **Example Request** + + .. sourcecode:: http + POST /api/printer/command HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "M27" + } + + + :json string command: The command to issue. + :statuscode 204: No error + .. _sec-api-printer-datamodel: Datamodel @@ -366,4 +393,4 @@ SD State Response * - ``ready`` - 1 - Boolean - - Whether the SD card has been initialized (``true``) or not (``false``). \ No newline at end of file + - Whether the SD card has been initialized (``true``) or not (``false``).