TODO
the following is a draft introduction
This document describes how to map the HTTP protocol to the W3C Web of Things.
This document is a work in progress
Vocabulary term | Description | Assignment | Type |
---|---|---|---|
htv:methodName |
HTTP method name (Literal). | optional |
string
(one of |
htv:headers |
HTTP headers sent with the message. | optional |
array of htv:MessageHeader
|
htv:fieldName |
Header name (Literal), e.g., "Accept" , "Transfer-Encoding" . |
mandatory within htv:MessageHeader |
string
|
htv:fieldValue |
Header value (Literal). | mandatory within htv:MessageHeader |
string
|
op value |
Default Binding |
---|---|
readproperty |
"htv:methodName": "GET" |
writeproperty |
"htv:methodName": "PUT" |
invokeaction |
"htv:methodName": "POST" |
readallproperties |
"htv:methodName": "GET" |
writeallproperties |
"htv:methodName": "PUT" |
readmultipleproperties |
"htv:methodName": "GET" |
writemultipleproperties |
"htv:methodName": "PUT" |
This section illustrates example sequences of application and protocol transactions that correspond to operations (defined in the Thing Description Specification) implementing various interactions among WoT Consumer and WoT Things. The illustrations show both the concrete protocol transactions and the interactions between the applications running inside the WoT Consumer and WoT Thing and the Consumed Thing and Exposed Thing abstractions.
For the sake of simplicity, remote and local proxies between the Consumer and the Thing are omitted from the following sequences. We also assume HTTP as the concrete protocol and omit any additional transactions for implementing security, such as those that would be used for authentication or to set up a secure connection for HTTPS. Other concrete protocols and the addition of security transactions however would only affect the concrete protocol transactions, not the application-level interactions with the Consumed Thing and Exposed Thing abstractions.
The following sequence illustrates application and network
transactions to implement the
readproperty
operation
with an HTTP protocol binding.
The following sequence illustrates application and network
transactions to implement the
writeproperty
operation
with an HTTP protocol binding.
The following sequence illustrates application and network
transactions to implement the
observeproperty
operation
with an HTTP protocol binding using
the "longpolling" (Long Polling) subprotocol.
The following sequence illustrates application and network
transactions to implement the observeproperty
operation
with an HTTP protocol binding using
the "sse" (Server Sent Event) subprotocol.
The following sequence illustrates application and network
transactions to implement the observeproperty
operation
with an HTTP protocol binding using
a WebSocket-based subprotocol.
The following sequence illustrates application and network
transactions to implement the
invokeaction
operation
with an HTTP protocol binding, where the
operation is synchronous and the response from the server
is delayed until after the action completes.
In the following, note that there is no explicit operation defined for event notification itself.
The subprotocol used for notification is associated with
the subscribeevent
operation, and any necessary concrete
protocol transactions are managed by the Protocol Binding subsystem.
There are also several subprotocols possible for event notification using WebSockets. The interaction diagrams show only one of several possible implementations.
The following sequence illustrates application and network
transactions to implement the
subscribeevent
and unsubscribeevent
operations
with an HTTP protocol binding using the Long Polling subprotocol.
The following sequence illustrates application and network
transactions to implement the
subscribeevent
and unsubscribeevent
operations
with an HTTP protocol binding using the Server Sent Event subprotocol.
The following sequence illustrates application and network
transactions to implement the subscribeevent
and unsubscribeevent
operations
with an HTTP protocol binding using a WebSocket subprotocol.