Our server is currently returning HTML responses. A humidity of 38% will give us this response:
<strong>38</strong>
While this works for our current setup, it is not ideal for when we need raw data, like we do now for making our charts. It is far easier to convert raw data to HTML as opposed to doing the opposite, so we can make our sensor displays compatible for raw data as well.
The most popular standard for data interchange, and one that is almost universal now, is JavaScript Object Notation (JSON). JSON is a very simple data interchange specification that is used to serialize data that is exchanged between applications. As we have been programming in JavaScript the whole time, JSON should feel very familiar to us.
In this section, we will be modifying our application server to return JSON responses, as opposed to the...