summaryrefslogtreecommitdiff
path: root/lazybones-client.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lazybones-client.lisp')
-rw-r--r--lazybones-client.lisp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lazybones-client.lisp b/lazybones-client.lisp
index 027ed2f..b17dacc 100644
--- a/lazybones-client.lisp
+++ b/lazybones-client.lisp
@@ -36,7 +36,7 @@ endpoint EP."
do (princ term)
when (listp term)
do (princ (car term))
- when more
+ when (and more (plusp (length term)))
do (princ "-"))))
(defun endpoint-defun-route-var-names (ep)
@@ -79,12 +79,15 @@ for making requests to endpoint EP."
embedded into the body of a defun for making requests to the
endpoint EP. It is desienged to be passed to FORMAT, where query
paramters are substituted into the string, if they exist."
- (str:join "&"
- (loop for varname in (endpoint-defun-query-var-names ep)
- collect (with-output-to-string (*standard-output*)
- (princ "~:[~;")
- (princ (string-upcase varname))
- (princ "=~a~]")))))
+ (with-output-to-string (*standard-output*)
+ (loop
+ for first = t then nil
+ for varname in (endpoint-defun-query-var-names ep)
+ do
+ (princ "~:[~;")
+ (unless first (princ #\&))
+ (princ (string-upcase varname))
+ (princ "=~a~]"))))
(defun endpoint-defun-dexador-request-uri (app ep)
"Returns a string representation of code that generates a URI for
@@ -108,7 +111,7 @@ for making requests to endpoint EP."
for making requests to the endpoint EP in the app APP."
(format
nil
- "(dexador:~a~%~s~%~{~a~%~})"
+ "(dexador:~a~%~a~%~{~a~%~})"
(string-downcase (symbol-name (lazybones::endpoint-method ep)))
(endpoint-defun-dexador-request-uri app ep)
'(":content %body%"