You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coming from discussions about Profiles 1.0, I would like to propose a binding template for Server-Sent Events (SSE), either as part of the HTTP Binding Template or a separate document.
Protocol Binding Template
For 1.x the key thing I think needs specifying is a default HTTP method for the subscribeevent and observeproperty operations when subprotocol is set to sse:
Note that unsubscribing/unobserving in SSE just involves dropping the HTTP connection, so a note could be added to that effect.
It might also be a good idea to explicitly say that the default content-type when subprotocol is set to sse should be text/event-stream.
Payload Binding Template
Beyond that, I also think we need a payload binding for the text/event-stream content type which as a minimum says:
For events the event field should map onto the name of the event and the data field should map onto the event payload, serialised in JSON by default, and conforming to the event data schema
For properties the event field should map onto the name of the property and the data field should map onto the property reading, serialised in JSON by default, conforming to the property data schema
(See also: #347 regarding how to override the default nested content type).
I'm not sure whether both the protocol binding and payload binding should be specified in the same document, or separate documents.
WoT 2.0
For WoT 2.0, I hope this binding template can be expanded into a "Server-Sent Events Protocol Binding" document which replaces (through defaults) the whole of the protocol binding for the current HTTP SSE Profile.
If observeable action operations are added to the Thing Description specification in the future, this could also be covered.
The text was updated successfully, but these errors were encountered:
Coming from discussions about Profiles 1.0, I would like to propose a binding template for Server-Sent Events (SSE), either as part of the HTTP Binding Template or a separate document.
Protocol Binding Template
For 1.x the key thing I think needs specifying is a default HTTP method for the
subscribeevent
andobserveproperty
operations when subprotocol is set tosse
:op
valuesubscribeevent
"htv:methodName": "GET"
observeproperty
"htv:methodName": "GET"
(See also: #330).
Note that unsubscribing/unobserving in SSE just involves dropping the HTTP connection, so a note could be added to that effect.
It might also be a good idea to explicitly say that the default content-type when
subprotocol
is set tosse
should betext/event-stream
.Payload Binding Template
Beyond that, I also think we need a payload binding for the
text/event-stream
content type which as a minimum says:event
field should map onto the name of the event and thedata
field should map onto the event payload, serialised in JSON by default, and conforming to the event data schemaevent
field should map onto the name of the property and thedata
field should map onto the property reading, serialised in JSON by default, conforming to the property data schema(See also: #347 regarding how to override the default nested content type).
I'm not sure whether both the protocol binding and payload binding should be specified in the same document, or separate documents.
WoT 2.0
For WoT 2.0, I hope this binding template can be expanded into a "Server-Sent Events Protocol Binding" document which replaces (through defaults) the whole of the protocol binding for the current HTTP SSE Profile.
If observeable action operations are added to the Thing Description specification in the future, this could also be covered.
The text was updated successfully, but these errors were encountered: