The default response to return when a Transit request is malformed.
The default response to return when a Transit request is malformed.
(transit-response response request {:keys [opts encoding charset]})
Create a transit response based on provided options. Will leave responses with non-transit Content Type will be returned unaltered.
Create a transit response based on provided options. Will leave responses with non-transit Content Type will be returned unaltered.
(wrap-transit-body handler)
(wrap-transit-body handler options)
Middleware that parses the body of Transit request maps, and replaces the :body key with the parsed data structure. Requests without a Transit content type are unaffected.
Accepts the following options:
:keywords? - true if the keys of maps should be turned into keywords :opts - a map of options to be passed to the transit reader :malformed-response - a response map to return when the Transit is malformed :malformed-response-fn - a custom error handler that gets called when the body is malformed transit. Will be called with three parameters: [exception request handler]
Middleware that parses the body of Transit request maps, and replaces the :body key with the parsed data structure. Requests without a Transit content type are unaffected. Accepts the following options: :keywords? - true if the keys of maps should be turned into keywords :opts - a map of options to be passed to the transit reader :malformed-response - a response map to return when the Transit is malformed :malformed-response-fn - a custom error handler that gets called when the body is malformed transit. Will be called with three parameters: [exception request handler]
(wrap-transit-params handler)
(wrap-transit-params handler options)
Middleware that parses the body of Transit requests into a map of parameters, which are added to the request map on the :transit-params and :params keys.
Accepts the following options:
:opts - a map of options to be passed to the transit reader :malformed-response - a response map to return when the Transit is malformed :malformed-response-fn - a custom error handler that gets called when the body is malformed transit. Will be called with three parameters: [exception request handler]
Use the standard Ring middleware, ring.middleware.keyword-params, to convert the parameters into keywords.
Middleware that parses the body of Transit requests into a map of parameters, which are added to the request map on the :transit-params and :params keys. Accepts the following options: :opts - a map of options to be passed to the transit reader :malformed-response - a response map to return when the Transit is malformed :malformed-response-fn - a custom error handler that gets called when the body is malformed transit. Will be called with three parameters: [exception request handler] Use the standard Ring middleware, ring.middleware.keyword-params, to convert the parameters into keywords.
(wrap-transit-response handler)
(wrap-transit-response handler options)
Middleware that converts responses with a map or a vector for a body into a Transit response.
Accepts the following options:
:encoding - one of #{:json :json-verbose :msgpack} :opts - a map of options to be passed to the transit writer
Middleware that converts responses with a map or a vector for a body into a Transit response. Accepts the following options: :encoding - one of #{:json :json-verbose :msgpack} :opts - a map of options to be passed to the transit writer
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close