function | previously cljs.repl.browser/read-post | Edit |
(read-post line rdr)
(defn read-post [line rdr]
(let [[_ file _] (str/split line #" ")
{:keys [path ref query-str]} (parse-file-parts file)
headers (parse-headers (read-headers rdr))
content-length (Integer/parseInt (:content-length headers))
content (char-array content-length)]
(io! (.read rdr content 0 content-length)
{:method :post
:path path
:ref ref
:query-str query-str
:headers headers
:content (String. content)})))