Skip to content

Instantly share code, notes, and snippets.

@DGaffney
Created September 5, 2014 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DGaffney/79f60f8beb3e5e9a1bbc to your computer and use it in GitHub Desktop.
Save DGaffney/79f60f8beb3e5e9a1bbc to your computer and use it in GitHub Desktop.
;Relevant line, inside a (defroutes app):
(ANY "/endpoint" {params :params} (respond (println (response/json params))))
Package I'm sending in via Ruby (:attributes is a list of maps, and it is becoming just the *last* map instead of being a list of them for some reason):
RestClient.post("http://0.0.0.0:8080/v1/node/create.json", {:id => "peat", :label => "Peat Bakke", :attributes => [{:for => "attribute_name", :value => 1}, {:for => "something_else", :value => "wee"}]})
Printout from clojure re the line above:
{:headers {Content-Type application/json; charset=utf-8}, :body {"attributes":{"value":"wee","for":"something_else"},"label":"Peat Bakke","id":"peat"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment