這是我找到的方式如下:
import subprocess
import json
# Get id
subprocess.call(["curl", "-i",
"http://localhost:port/devices/?query=%7B%22_id%22%3A%[機器條碼]%22%7D"])
# Post connection request
subprocess.call(["curl", "-i",
"http://localhost:port/devices/[機器條碼]/tasks?connection_request", "-X",
"POST", "