0
import http.client
conn = http.client.HTTPConnection("localhost:8181")
device_id = 1
while device_id < 1000:
payload = "\n{\n \"deviceId\": \"device_id\",\n \"osVendor\": \"abcd\"\n}"
headers = {
'content-type': "application/json",
'cache-control': "no-cache",
'postman-token': "03ac94dc-d208-95dd-7bf2-2e6c1f194316"
}
conn.request("POST", "/PNBQC/v1/registerbox", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
- 我需要增加的DEVICE_ID直到1000,但它的执行字符串,因为它是不是值。 慷慨提供解决方案。 在此先感谢。