    resource. This is a 405 status code. Information from the request is used to
    provide a reasonable message."
   [{:keys [uri request-method] :as request}]
-  (-> (str "invalid method (" (name (or request-method "UNKNOWN")) ") for " (or uri "UNKNOWN"))
-      (ex-response 405 uri)))
+  (let [msg (format "invalid method (%s) for %s"
+                    (name (or request-method "UNKNOWN"))
+                    (or uri "UNKNOWN"))]
+    (ex-response msg 405 uri)))
 
 
 (defn ex-bad-action


(defn response-not-found
  [id]
  (-> (str id " not found")
      (map-response 404 id)))


(defn response-error

   identifier and provides the Set-Cookie header with the given cookie, if
   the cookie value is not nil."
  [id & [[cookie-name cookie]]]
  (cond-> {:status  201
           :headers {"Location" id}
           :body    {:status      201
                     :message     (str id " created")
                     :resource-id id}}
          cookie (assoc :cookies {cookie-name cookie})))


