From c38bcb25aa1805009e399cea40e66d6f31195744 Mon Sep 17 00:00:00 2001 From: winter Sparkles Date: Mon, 27 Apr 2026 21:55:21 +0100 Subject: add requests (but not responses yet) --- docs/examples.md | 3 +++ docs/write-request.example.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 docs/write-request.example.c (limited to 'docs') 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 + +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); +} -- cgit v1.3