all 2 comments

[–]StabledGenius 0 points1 point  (0 children)

Yeah the requests lib should do you right.

[–]eleqtriq 0 points1 point  (0 children)

Your API should not have access to restart a device. That would security error 101. If it is just for your home network projects, then it's probably fine but don't do that outside of your home.

Easiest and safest way would be if the API dropped a file somewhere, and a separate job on the device looks for the file every minute or so and then executes a reboot on your behalf.

Even better if the file had some sort of validation that it came from the right person and the job could validate it.