            ratpack.handling.Context
            ratpack.http.Request
            ratpack.http.Response
+           ratpack.http.ResponseMetaData
            ratpack.http.Headers
            ratpack.http.TypedData
            ratpack.http.MutableHeaders

  (set-headers* [_ _]
    (throw (UnsupportedOperationException.)))

  Response
  (get-headers* [_]
    (throw (UnsupportedOperationException.)))

  (set-headers* [^Response response headers]
    (let [^MutableHeaders headersmap (.getHeaders response)]
      (loop [headers headers]
        (when-let [[key vals] (first headers)]
          (.set headersmap (name key) vals)
          (recur (rest headers)))))))


(defn- cookie->map
  [^Cookie cookie]

  (set-status* [^DefaultContext ctx ^long status]
    (set-status* (:response ctx) status))

  ResponseMetaData
  (set-status* [^ResponseMetaData response ^long status]
    (.status response status)))

(extend-protocol IRequest
