Closed stmb-100 closed 2 years ago
I found the bug myself
import json
import requests
# 0_userdata.0.Test.Test_001
url = "http://192.168.0.83:8087"
point = "0_userdata.0.Test.Test_001/"
cmd = "/get/"
pp = "&prettyPrint"
apiurl_1 = url + cmd + point + pp
print(apiurl_1)
headers = {'Content-Type': 'text/html'}
payload={}
#Making http post request
response = requests.request("GET", apiurl_1, headers=headers, data=payload)
print(response.json())
cmd = "/set/"
value = "?value=700"
apiurl_2 = url + cmd + point + value + pp
print(apiurl_2)
payload={}
response = requests.request("GET", apiurl_2, headers=headers, data=payload)
print(response.json())
response = requests.request("GET", apiurl_1, headers=headers, data=payload)
print(response.json())
Please try it as the example shows it ... https://github.com/ioBroker/ioBroker.simple-api#get
Hi, everyone can someone please help me and tell me what I'm doing wrong. I'm trying to send an API request with Python3 to the IOBroker Simple API and get an error message back. When I call the url in the browser it works.
The log in the adapter Instance is set to "ALL" but no log entry is created. A log entry is created when sending with the browser.
R Stefan