Closed xingzheone closed 5 years ago
Using .reset
is not that simple. Not all InputStream
support mark
and reset
. Even if the used InputStream
implementation supports these, .reset
only moves the position of the stream to the position where it was when .mark
was last called, and only if no more than readlimit
bytes where read since mark
was called.
(defn get-post-body-data [{:keys [body request-method] :as req}]
(if (and (= :post request-method) body)
(try
(let [_ (.reset body)
r (slurp body)
_ (.reset body)]
;(assoc req :bodyp r)
r)
(catch Exception e
(.printStackTrace e)
)))
)
my Monitor use this fn . and work fine
Library Version(s)
https://stackoverflow.com/questions/9501237/read-stream-twice
Problem
374