WebThingsIO / webthing-arduino

Simple server for ESP8266, ESP32, Ethernet, or WiFi101-compatible boards compliant with Mozilla's proposed WoT API
Mozilla Public License 2.0
207 stars 78 forks source link

Support Web Thing API to get all properties #50

Closed nedw closed 5 years ago

nedw commented 5 years ago

This change adds the ability to retrieve all properties in a single request, as defined in the Web Thing API section 3.2 ("Properties resource"):

GET http://mythingserver.com/things/pi/properties

As part of this support, requests to retrieve an unknown property will return a 404 error:

GET http://mythingserver.com/things/pi/properties/bad
HTTP/1.1 404 Not Found

The Thing description will now include a links member (section 2.8) with a suitable "properties" definition:

"links": [
        {
            "href": "/things/pi/properties",
            "rel": "properties"
        }
    ],