From c1be1b39cf91acc76441a176bab3e66a0f475e39 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 22 Sep 2023 18:51:24 +0200 Subject: [PATCH] README - Added example usage - Added link documentation --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bce71e..96613e0 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,25 @@ doap ## Usage -TODO: Add docs +Documentation is available [here](https://doap.dpldocs.info/). + +### Making a request ``` +CoapClient client = new CoapClient("coap.me", 5683); + +CoapRequestFuture future = client.newRequestBuilder() + .payload(cast(ubyte[])"Hello this is Tristan!") + .token([69]) + .post(); + + +writeln("Future start"); +CoapPacket response = future.get(); +writeln("Future done"); +writeln("Got response: ", response); + +client.close(); ``` ## License