doap/README.md

36 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

![](branding/logo.png)
2023-09-12 17:40:43 +01:00
doap
====
2023-09-25 13:52:50 +01:00
![DUB](https://img.shields.io/dub/v/doap?color=%23c10000ff%20&style=flat-square) ![DUB](https://img.shields.io/dub/dt/doap?style=flat-square) ![DUB](https://img.shields.io/dub/l/doap?style=flat-square) [![D](https://github.com/deavmi/doap/actions/workflows/d.yml/badge.svg?branch=master)](https://github.com/deavmi/doap/actions/workflows/d.yml) [![Coverage Status](https://coveralls.io/repos/github/deavmi/doap/badge.svg?branch=master)](https://coveralls.io/github/deavmi/doap?branch=master)
2023-09-12 17:43:55 +01:00
2023-09-12 17:40:43 +01:00
**doap** is a CoAP library for the D programming language.
2023-09-12 17:41:11 +01:00
## Usage
Documentation is available [here](https://doap.dpldocs.info/).
### Making a request
2023-09-12 17:41:11 +01:00
2023-09-25 12:57:01 +01:00
```d
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();
2023-09-12 17:41:11 +01:00
```
2023-09-12 17:40:43 +01:00
## License
2023-09-12 17:43:55 +01:00
This project is licensed under the [LGPL v3.0](LICENSE).