Open jkaan opened 9 years ago
@jkaan I'm running OLA 0.9.5 as a deb package, and the code here works fine for me: https://wiki.openlighting.org/index.php/OLA_JSON_API
Can you test that Perl code, then we can try and narrow down what's happening.
That code is also working for me. How's it possible that it's not working with the above two programs ?
Can you take a tcpdump of the connection and see what the difference between the two are.
On Thu, Mar 12, 2015 at 3:50 PM, Joey Kaan notifications@github.com wrote:
That code is also working for me. How's it possible that it's not working with the above two programs ?
— Reply to this email directly or view it on GitHub https://github.com/OpenLightingProject/ola/issues/672#issuecomment-78494720 .
If you give the HTTPie or postman command lines you're using, it may be someone can help you diagnose it.
I might have figured out the issue. The call fails if I sent along JSON like this
{
u: 1.
d: "0,1,2,3,4,5,6"
}
However if I sent the data in a format which is equal to POSTing a form then it works. This seems an issue to me because if the API doesn't support the JSON format it should return some sort of error ?
correct. /set_dmx works with form formatted post query's not json.
We really need to redo the entire JSON api.
a summary of what needs to happen for the issue to close: POST requests have to accept json input, all GET requests already return json I believe
I have looked, and this might be impossible with the library we currently use (libmicrohttpd). Since there is no way (as far as I can see) to extract the Json posted to the api
Whenever I try to POST to /set_dmx with any data I get no response.
I've tried HTTPie (https://github.com/jakubroztocil/httpie) which returns a connection aborted error.
I've also tried Postman which returns this: Could not get any response This seems to be like an error connecting to http://192.168.101.254:9090/set_dmx. The response status was 0.
The actual data I'm sending is this: u=1 d="2,5,5"