Fork me on GitHub
#planck
<
2019-10-28
>
austin.chamberlin16:10:40

anybody know how to post a json payload with planck.http?

mfikes16:10:23

@austin.chamberlin Via opts you can control things like :accept an :content-type

mfikes16:10:17

(Be sure to check out “the relevant options for get”)

austin.chamberlin16:10:43

Part of the trouble is I don't understand much about http.

(def payload "{\"some\": \"json\"}")
(planck.http/post "" {:content-type :json } )

austin.chamberlin16:10:57

I'm wondering how I would send that payload

mfikes16:10:51

It would go under the :body key in opts

mfikes16:10:16

No problem

austin.chamberlin21:10:20

Got another q: Is there a way to prompt for interactive input like:

Do the thing? (y/n):

bfabry21:10:15

user=> (read-line) y “y”

bfabry21:10:24

requires user to hit enter

mfikes22:10:29

In addition to planck.core/read-line there is also planck.core/read-password which protects the input terminal.