Skip to content

Commit

Permalink
chore(examples): add HTTP support to main example
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 27, 2024
1 parent 0badb0b commit fef513d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Below you can find a basic example for incrementing and reading the value of a
counter Thing, which is part of the
[Thingweb Online Things](https://www.thingweb.io/services).

In the example, we first create a WoT runtime using a `Servient` with CoAP
support.
In the example, we first create a WoT runtime using a `Servient` with CoAP and
HTTP support.
With the runtime, we then retrieve a TD (using the `requestThingDescription()`
method) and consume it (using the `consume()` method), creating a
`ConsumedThing` object,
Expand All @@ -56,12 +56,14 @@ Afterward, the actual interactions with the counter are performed by calling the

```dart
import "package:dart_wot/binding_coap.dart";
import "package:dart_wot/binding_http.dart";
import "package:dart_wot/core.dart";
Future<void> main(List<String> args) async {
final servient = Servient(
clientFactories: [
CoapClientFactory(),
HttpClientFactory(),
],
);
final wot = await servient.start();
Expand Down
2 changes: 2 additions & 0 deletions example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
// ignore_for_file: avoid_print

import "package:dart_wot/binding_coap.dart";
import "package:dart_wot/binding_http.dart";
import "package:dart_wot/core.dart";

Future<void> main(List<String> args) async {
final servient = Servient(
clientFactories: [
CoapClientFactory(),
HttpClientFactory(),
],
);
final wot = await servient.start();
Expand Down

0 comments on commit fef513d

Please sign in to comment.