             [byte-streams :as bs]
             [manifold.deferred :as md]
             [promissum.core :as p]
+            [buddy.core.codecs :as codecs]
             [cats.core :as m]
             [cats.monad.exception :as exc]
             [catacumba.core :as ct]

    (pc/decode data :application/transit+json)))

(defn- send-raw-frame
  [uri frame content-type]
  (let [headers {"content-type" content-type}]
    (http/put uri {:body frame :headers headers})))

(defn- send-frame
  [uri frame]
  (let [data (pc/encode frame :application/transit+json)]
    @(md/chain
      (send-raw-frame uri data "application/transit+json")
      response->frame)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Helpers

  (with-server {:handler (pc/router (constantly {}))}
    (let [frame (pr-str {:type :query :data nil})
          response (exc/try-on
                    @(send-raw-frame base-url :put frame "application/edn"))]
      (is (exc/failure? response))
      (let [response (m/extract response)
            data (ex-data response)]
