How to set custom header names in handlers, actions and predicates?
32 views
Skip to first unread message
Hussein B.
unread,
Aug 27, 2015, 10:29:14 AM8/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Liberator
Hi,
In our organization, we are using JSON but use our special header for that. For example:
application/x.company.project+json;version=1
And when there is error:
application/proplery+json
How to set those headers in actions, predicates and handlers?
Philipp Meier
unread,
Aug 28, 2015, 4:02:13 AM8/28/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clojure-...@googlegroups.com
Hi Hussein,
Am 27.08.15 um 16:29 schrieb Hussein
B.:
You need to declare the media-type as the available media-type. When
the handler returns
String, File or an InputStream, then liberator will use this the
response body:
If you want to use liberator's representation
generation for maps and sequences the you'll need define a
multimethod implementation for it: (defmethod
liberator.representation/render-map-generic
"application/x.company.project+json;version=1" [data
ctx]
(json/write-str data))