I'm trying to swap "textContent" with an :hx-post but I get one of these as I try to issue the response:
[qtp335937419-28] ERROR com.biffweb.impl.middleware - Exception while handling request
java.lang.IllegalArgumentException: contains? not supported on type: java.lang.String
at clojure.lang.RT.contains(RT.java:853)
at clojure.core$contains_QMARK_.invokeStatic(core.clj:1506)
at clojure.core$contains_QMARK_.invoke(core.clj:1498)
In this case, I really do want to return a raw string and not HTML exactly...is there a convenient work around for this case?You can return plain text by returning a full response map instead of just hiccup/rum:
(defn my-handler [ctx]
{:status 200
:headers {"content-type" "text/plain"}
:body "hello"})
(If you return a vector instead of a map, Biff's middleware assumes it's hiccup and expands it into a map like the above, but with "content-type" "text/html")If you do this often, you could write some middleware that checks if the response is a string and expands it into a map .