Last active
January 2, 2016 18:29
-
-
Save ordnungswidrig/8343552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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