diff options
| author | winter Sparkles | 2026-04-27 21:55:21 +0100 |
|---|---|---|
| committer | winter Sparkles | 2026-04-27 21:55:21 +0100 |
| commit | c38bcb25aa1805009e399cea40e66d6f31195744 (patch) | |
| tree | 1ac302eb72966eaf106e8cb070a7a32def8370b0 /docs | |
| parent | 05a9d192ee17c503172e785fd1383a62f2feb20b (diff) | |
add requests (but not responses yet)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/examples.md | 3 | ||||
| -rw-r--r-- | docs/write-request.example.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/docs/examples.md b/docs/examples.md index b517053..9d2a6d1 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -7,3 +7,6 @@ Example of constructing a service and writing it out: Example of reading a service in and printing it for debugging: \include read-service.example.c + +Example of making a request (to stdout instead of a transport): +\include write-request.example.c diff --git a/docs/write-request.example.c b/docs/write-request.example.c new file mode 100644 index 0000000..3abe82e --- /dev/null +++ b/docs/write-request.example.c @@ -0,0 +1,14 @@ +#include <libsparklepaw/request.h> + +void main() { + struct sprkl_request* request = sprkl_request_make_fetchservice( + SPRKL_SIGALGO_ED25519, + "aaaabbbbccccddddaaaabbbbccccddddaaaabbbbccccddddaaaabbbbccccdddd", + 0 + ); + + int n = sprkl_request_write(request, stdout); + fprintf(stderr, "\nWrote %d bytes\n", n); + + sprkl_request_freeall(request); +} |
