From d120749cde4ca907b059236dbe05881aa4aae332 Mon Sep 17 00:00:00 2001 From: Ben Ashton Date: Sun, 16 Oct 2022 15:05:43 -0600 Subject: [PATCH] Added convenience method for sending JSON --- src/exprash.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/exprash.sh b/src/exprash.sh index 1296b98..1dba318 100644 --- a/src/exprash.sh +++ b/src/exprash.sh @@ -206,6 +206,11 @@ function send() { _sendRaw } +function sendJson() { + setHeader 'Content-Type' 'application/json' + send +} + # $1: Path function redirect() { local path="$1"