From 11d6d0d637c12be4f7307e65e2fa496d1777cadc Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 8 Mar 2025 00:58:32 -0500 Subject: README.md: document JSON "API" --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 834e9ca..0998e74 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ Build and run container using [Podman][]: Then open in your browser. +By default the sentences are returned as plain text delimited by +newlines. If the request method is POST and the `Accept` header is set +to `application/json`, then the sentences are returned as a +[JSON][]-encoded array. + +Example: + + $ curl -X POST -H 'accept: application/json' http://localhost:8080/ + ["uniquely myocardinate communities",... + ## Build To build locally (requires [Go][]): @@ -54,3 +64,5 @@ Note: The `check` target requires [staticcheck][]. "Go programming language" [staticcheck]: https://staticcheck.dev/docs/ "Go static analyzer." +[json]: https://json.org/ + "JavaScript Object Notation" -- cgit v1.2.3