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
Copy file name to clipboardExpand all lines: index.html
+42-27Lines changed: 42 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -382,7 +382,7 @@
382
382
Implementations that use TypeScript or ECMAScript in a runtime to implement the APIs defined in this document MUST implement them in a manner consistent with the TypeScript Bindings defined in the TypeScript specification [[!TYPESCRIPT]].
383
383
</p>
384
384
</section>
385
-
385
+
386
386
<section><h2>Terminology and conventions</h2>
387
387
<p>
388
388
The generic WoT terminology is defined in [[!WOT-ARCHITECTURE]]: <dfndata-lt="Things">Thing</dfn>, <dfndata-lt="Thing Descriptions">Thing Description</dfn> (in short <dfn>TD</dfn>), <dfn>Partial TD</dfn>, <dfn>Web of Things</dfn> (in short <b><i>WoT</i></b>), <dfn>WoT Interface</dfn>, <dfn>Protocol Bindings</dfn>, <dfn>WoT Runtime</dfn>, <dfndata-lt="consume|consume a TD|consuming a TD">Consuming a Thing Description</dfn>, <dfn>TD Directory</dfn>, <dfndata-lt="Properties">Property</dfn>, <dfndata-lt="Actions">Action</dfn>, <dfndata-lt="Events|WoT-Event">Event</dfn>,
a <adata-cite="infra#parse-json-bytes-to-a-javascript-value">parsed JSON object</a> that is validated using <adata-cite="WOT-TD#json-schema-for-validation">JSON Schema validation</a>.
491
491
</p>
492
-
<section><h3>Fetching a Thing Description</h3>
492
+
<section><h3>Requesting a Thing Description</h3>
493
493
<p>
494
-
Fetching a <a>TD</a> given a URL should be done with an external method, such as the <adata-cite="fetch#fetch-api">Fetch API</a> or a HTTP client library, which offer already standardized options on specifying fetch details.
494
+
Requesting a <a>TD</a> given a URL should be done with the
into consideration when designing a Scripting API for WoT.
4281
4281
</p>
4282
4282
</section>
4283
-
<section><h4>Fetching and validating a TD</h4>
4283
+
<section>
4284
+
<h4>Requesting and validating a TD</h4>
4284
4285
<p>
4285
-
The <code>fetch(url)</code> method has been part of this API in earlier versions. However, now fetching a <a>TD</a> given a URL should be done with an external method, such as the <adata-cite="fetch#fetch-api">Fetch API</a> or a HTTP client library, which offer already standardized options on specifying fetch details. The reason is that while simple fetch operations (covering most use cases) could be done in this API, when various fetch options were needed, there was no point in duplicating existing work to re-expose those options in this API.
4286
+
The current version of this specification defines a new
4287
+
`requestThingDescription` method that simplifies the process of
4288
+
retrieving and validating a Thing Description.
4289
+
However, it only covers simple use cases that do not require additional
4290
+
parameters or special HTTP headers for the retrieval.
4286
4291
</p>
4287
4292
<p>
4288
-
Since fetching a <a>TD</a> has been scoped out, and <a>TD</a> validation
4289
-
is defined externally in the [[[WOT-TD]]] specification, that is scoped out, too.
4290
-
This specification expects a <a>TD</a> as
4291
-
<adata-cite="infra#parse-json-bytes-to-a-javascript-value">parsed JSON object</a> that has been validated according to the [[[WOT-TD]]] specification.
4293
+
More sophisticated use cases need to be covered by external methods, such
4294
+
as the <adata-cite="fetch#fetch-api">Fetch API</a> or an
4295
+
HTTP client library, which offer already standardized options on
4296
+
specifying fetch details.
4297
+
In these cases, the user is required to perform validation manually as
4298
+
described by the [[[WoT-TD]]] specification.
4292
4299
</p>
4300
+
<pclass="ednote" title="Extending the `requestThingDescription()` method">
4301
+
In the future, `requestThingDescription()` might be extended with an
4302
+
`options` argument, including frequently used `fetch` options.
0 commit comments