xeqi / peridot

a basic api for interacting with ring apps
145 stars 20 forks source link

how do i mock a json post request? #12

Closed zcaudate closed 11 years ago

zcaudate commented 11 years ago

I've written up the question here on stackoverflow

http://stackoverflow.com/questions/17035319/how-do-i-mock-a-json-post-request-in-ring

I'm trying to use peridot to mock json data that is posted and I am getting a SteamClosed Exception everytime I'm trying to access the body.

Is there another way to do this?

xeqi commented 11 years ago
(-> (session app)
    (request "/test/json"
             :request-method :post
             :content-type "application/json"
             :body (.getBytes "\"hello\"" "UTF-8")))

Slightly longer answer on SO.