cmr.http.kit.response
This namespace defines a default set of transform functions suitable for use in presenting results to HTTP clients.
Note that ring-based middleeware may take advantage of these functions either by single use or composition.
add-header
(add-header response field value)Documentation forthcoming
client-handler
(client-handler response)(client-handler response err-handler)(client-handler {:keys [status headers body error]} err-handler parse-fn)Documentation forthcoming
cors
(cors request response)Documentation forthcoming
error
(error error)Documentation forthcoming
error-handler
(error-handler status headers body)(error-handler status headers body default-msg)Documentation forthcoming
errors
(errors errors)Documentation forthcoming
html
(html request data)(html _request process-fn data)Documentation forthcoming
json
(json request data)(json _request process-fn data)Documentation forthcoming
json-errors
(json-errors body)Documentation forthcoming
json-handler
Documentation forthcoming
maybe-deref
(maybe-deref maybe-ref)Documentation forthcoming
not-allowed
(not-allowed message)(not-allowed message other-errors)Documentation forthcoming
not-found
(not-found _request)Documentation forthcoming
ok
(ok _request & args)Documentation forthcoming
parse-json-body
(parse-json-body body)Documentation forthcoming
parse-xml-body
(parse-xml-body body)Documentation forthcoming
process-err-results
(process-err-results data)Documentation forthcoming
process-ok-results
(process-ok-results data)Documentation forthcoming
process-results
(process-results data)(process-results err-fn data)(process-results err-fn ok-fn data)Documentation forthcoming
soft-reference->json!
(soft-reference->json! obj json-generator)Given a soft reference object and a Cheshire JSON generator, write the data stored in the soft reference to the generator as a JSON string.
Note, however, that sometimes the value is not a soft reference, but rather a raw value from the response. In that case, we need to skip the object conversion, and just do the realization.
stream->str
(stream->str body)Documentation forthcoming
text
(text request data)(text _request process-fn data)Documentation forthcoming
version-media-type
(version-media-type response value)Documentation forthcoming
xml-errors
(xml-errors body)Documentation forthcoming
xml-handler
Documentation forthcoming