Hi,

I'm using e.g.this:

    (let [response (app (request :post "/user-register"
                                 {:par1 "val" :par2 "val"}))]  )

This works, but now I have a service that is provided by external library 
and requires the type of the request to be explicitly set to 
application/json. How do I do this?


I checked the 
api<http://weavejester.github.io/ring-mock/ring.mock.request.html> there's 
a "content-type" function:

content-type
(content-type request mime-type)

Set the content type of the request map.

I tried

(let [response (app
                    (content-type (request :post "/login" {:username "jane" 
:password "test"})
                                  "application/json"))]  )


Doesn't work...


Also found this 
entry<http://stackoverflow.com/questions/17035319/how-do-i-mock-a-json-post-request-in-ring>in
 StackOverflow asking the same, but also seems not to work + don't like 
having to pass the body as escaped string instead of a map...


Thanks.






-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to