From 30a034b30b66694447fc38172a2265a1095af222 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 23 Jun 2024 14:43:20 -0700 Subject: Add: client generator for dexador --- src/client/ps/generate.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/client/ps/generate.lisp') diff --git a/src/client/ps/generate.lisp b/src/client/ps/generate.lisp index 11b0c53..f6f317b 100644 --- a/src/client/ps/generate.lisp +++ b/src/client/ps/generate.lisp @@ -4,13 +4,13 @@ (:local-nicknames (#:wknd #:weekend) (#:a #:alexandria-2)) - (:export #:parenscript)) + (:export #:generate)) (in-package #:weekend.client.ps) ;; this function largely mirrors the implementation of construct-route-builder -(defun generate-endpoint-client (class) +(defun generate (class) (when (symbolp class) (setf class (find-class class))) (let* @@ -26,6 +26,7 @@ :collect (intern (string part)))) (method (wknd:request-method class)) + (body (when (wknd:body-expected-p method) `(ps:chain -J-S-O-N @@ -51,6 +52,6 @@ method ,(string method) cache "no-cache" headers (ps:create "Content-Type" "application/json") - redirect follow + redirect "follow" ,@(when body (list 'body body))))))) -- cgit v1.2.3