fredrik-corneliusson / click-web

Serve click scripts over the web
MIT License
266 stars 17 forks source link

Add simple raw API to make commands easier to call from scripts #17

Closed fredrik-corneliusson closed 4 months ago

fredrik-corneliusson commented 4 months ago

In some cases it is useful to call the server endpoints via simple scripts or curl without a web ui. The current HTML form post API not suitable for this. So implement a simple way to run the command as raw text in a form post. Example curl --request POST --url http://127.0.0.1:5000/_rawcmd --header 'Content-Type: text/plain' --data 'print-lines 5 --delay 1 --message Red'

The API is then very similar to how the click command would have been run on command line. Note: In order for this to work some more advanced features will not be supported such as file upload/download.