New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mock client sends invalid JSON POST request to ambi backend for sensor readings #1
Comments
One note, temperature is spelled "tempurature" which is not correct. |
Ah I think I know what the issue is, Wireshark doesn't see the JSON as JSON, nor will the Phoenix server because we're not passing the content-type in the HTTP header like I do in the full hardware client, e.g.: https://github.com/Jim-Hodapp-Coaching/ambi_client_cpp/blob/7aac57aa8a82d1a29085f185eed6b34582322c79/src/http_client.cpp#L132 |
Yes, that's what I thought. I saw an example on stackoverflow (can't link it because SO is offline for maintenance) where somebody suggested using .json() method and sets the header accordingly to this. Though when I tried to do it quickly, lsp told me that .json method doesn't exist so maybe I missed something and simply setting .header(json/application (or sth like that)) should suffice |
Ambi backend interprets JSON here
Currently, the mock client sends an invalid JSON request, which ambi receives and is unable to parse.
This results in an empty parameters field on the backend.
See this issue for an example of the ambi response
The text was updated successfully, but these errors were encountered: