Closed 42Willow closed 2 years ago
Hi @Burraby,
First, it's because you did not specify the default port in the URL (8080
, or a different one if you changed it).
Second, you have to pass the query as json
, not params
.
The following code should work:
import requests
query = {
"device": "device_0",
"effect": "effect_single"
}
r = requests.post('http://192.168.1.90:8080/api/effect/active', json=query)
print(r)
This should print <Response [200]>
.
Hi @Burraby,
First, it's because you did not specify the default port in the URL (
8080
, or a different one if you changed it). Second, you have to pass the query asjson
, notparams
. The following code should work:import requests query = { "device": "device_0", "effect": "effect_single" } r = requests.post('http://192.168.1.90:8080/api/effect/active', json=query) print(r)
This should print
<Response [200]>
.
Thank you for the quick reply, it works!
I get a 403 response which according to the documentation means
input data are wrong
. Does anyone know how to solve this?