Skip to content

Instantly share code, notes, and snippets.

@ordnungswidrig
Last active January 2, 2016 18:29
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 ordnungswidrig/8343552 to your computer and use it in GitHub Desktop.
Save ordnungswidrig/8343552 to your computer and use it in GitHub Desktop.
(def base-resource-media-typed
{"application/json"
{:success false
:message "No acceptable resource available"}
"application/edn"
{:success false
:message "No acceptable resource available"}})
(def base-resource
{:handle-not-acceptable (media-typed base-resource-media-typed)
:handle-created "You created something."})
(defresource my-resource base-resource
:handle-not-acceptable
(media-typed base-resource-media-typed
{"application/edn" {:success false :message "custom response"}}))
:handle-ok "All's well.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment