Fork me on GitHub
#ring
<
2021-07-02
>
teodorlu14:07:20

Hi! When I POST to my endpoint, ring.adapter.jetty gives me a :body of type org.eclipse.jetty.server.HttpInputOverHTTP. How can I create an instance of HttpInputOverHTTP from a string? That would help me work from the REPL.

✔️ 4
teodorlu14:07:49

Hmm, perhaps I can just create an input stream. The spec says that the body should be a java.io.InputStream.

:body
  (Optional, java.io.InputStream)
  An InputStream for the request body, if present.

teodorlu14:07:44

Looks like (io/input-stream (.getBytes "{\"my\":\"json\"")) might just be it. Don't mind me! duckie