Liking cljdoc? Tell your friends :D

liberator.representation


->whencljmacro

(->when form pred & term)
source

default-dictionaryclj

(default-dictionary k lang)
source

html-tableclj

(html-table data fields lang dictionary)
source

in-charsetclj

(in-charset string charset)
source

parsable-content-type?clj

(parsable-content-type? ctx)

Tells if the request has a content-type that can be parsed by the default implementation for :processable?

Tells if the request has a content-type that can be parsed by
the default implementation for :processable?
sourceraw docstring

parse-request-entitycljmultimethod

source

render-as-clojureclj

(render-as-clojure data)
source

render-as-ednclj

(render-as-edn data)
source

render-itemcljmultimethod

source

render-map-genericcljmultimethod

dispatch on media type

dispatch on media type
sourceraw docstring

render-seq-csvclj

(render-seq-csv data
                {{:keys [language] :as representation} :representation
                 :keys [dictionary fields]
                 :or {dictionary default-dictionary fields (keys (first data))}
                 :as context}
                sep)
source

render-seq-genericcljmultimethod

source

render-seq-html-tableclj

(render-seq-html-table
  data
  {{:keys [media-type language] :as representation} :representation
   :keys [dictionary fields]
   :or {dictionary default-dictionary fields (keys (first data))}
   :as context}
  mode)
source

Representationcljprotocol

as-responseclj

(as-response _ {representation :representation :as context})

Coerce to a standard Ring response (a map containing :status, :headers and :body). Developers can call as-response directly, usually when they need to augment the context. It does all the charset conversion and encoding and returns are Ring response map so no further post-processing of the response will be carried out.

Coerce to a standard Ring response (a map
containing :status, :headers and :body). Developers can call
as-response directly, usually when they need to augment the context. It
does all the charset conversion and encoding and returns are Ring
response map so no further post-processing of the response will be
carried out.
source

ring-responseclj

(ring-response ring-response-map)
(ring-response value ring-response-map)

Returns the given map as a ring response. The map is not converted with as-response.

An optional representation value will be converted to a ring-response using as-response as usual and the ring-response parameter will be merged over it.

The merge is done with liberator.core/combine and thus merges recursively.

Example:

A handler returns

(ring-response {:foo :bar} {:status 999 :headers {"X-Custom" "value"})

The final response will have the overriden status code 999 and a custom header set. Assuming the negotiated content type was application/json the response will be

{:headers {"Content-Type" "application/json" "X-Custom" "value"} :status 999 :body "{'foo': 'bar'}"}

Returns the given map as a ring response. The map is not converted
with `as-response`.

An optional representation value will be converted to a ring-response
using `as-response` as usual  and the ring-response parameter will be
merged over it.

The merge is done with `liberator.core/combine` and thus merges
recursively.

Example:

A handler returns

  (ring-response {:foo :bar}
                 {:status 999
                  :headers {"X-Custom" "value"})

The final response will have the overriden status code 999 and a
custom header set. Assuming the negotiated content type was
application/json the response will be

  {:headers {"Content-Type" "application/json"
             "X-Custom" "value"}
   :status 999
   :body "{'foo': 'bar'}"} 
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close