Liking cljdoc? Tell your friends :D

fierycod.holy-lambda.response

Response helpers adapted from ring-core/util/response.clj

Response helpers adapted from ring-core/util/response.clj
raw docstring

bad-requestclj

(bad-request body)

Returns a 400 'bad request' response.

Returns a 400 'bad request' response.
raw docstring

charsetclj

(charset resp ?charset)

Returns an updated response with the supplied charset added to the Content-Type header.

Returns an updated response with the supplied charset added to the
Content-Type header.
raw docstring

content-typeclj

(content-type resp ?content-type)

Returns an updated response with the a Content-Type header corresponding to the given content-type.

Returns an updated response with the a Content-Type header corresponding
to the given content-type.
raw docstring

createdclj

(created url)
(created url body)

Returns a response for a HTTP 201 created response.

Returns a response for a HTTP 201 created response.
raw docstring

credentialsclj

(credentials resp ?creds)

find-headerclj

(find-header resp header-name)

Looks up a header in a response (or request) case insensitively, returning the header map entry, or nil if not present.

Looks up a header in a response (or request) case insensitively,
returning the header map entry, or nil if not present.
raw docstring

get-headerclj

(get-header resp header-name)

Looks up a header in a response (or request) case insensitively, returning the value of the header, or nil if not present.

Looks up a header in a response (or request) case insensitively,
returning the value of the header, or nil if not present.
raw docstring

(header resp ?name value)

Returns an updated response with the specified header added.

Returns an updated response with the specified header added.
raw docstring

jsonclj

(json body)

Returns a skeletal response with the given body, status of 200, and Content-Type set to application/json.

Returns a skeletal response with the given body, status of 200, and `Content-Type` set to `application/json`.
raw docstring

not-foundclj

(not-found body)

Returns a 404 'not found' response.

Returns a 404 'not found' response.
raw docstring

originclj

(origin resp ?origin)

redirectclj

(redirect url)
(redirect url status)

Returns a response for an HTTP 302 redirect. Status may be a key in redirect-status-codes or a numeric code. Defaults to 302

Returns a response for an HTTP 302 redirect. Status may be
a key in redirect-status-codes or a numeric code. Defaults to 302
raw docstring

redirect-status-codesclj

Map a keyword to a redirect status code.

Map a keyword to a redirect status code.
raw docstring

responseclj

(response body)

Returns a skeletal response with the given body, status of 200, and no headers.

Returns a skeletal response with the given body, status of 200, and no
headers.
raw docstring

(set-cookie resp {:keys [k v] :as opts})

Sets a cookie on the response.

Sets a cookie on the response.
raw docstring

statusclj

(status ?status)
(status resp ?status)

Returns an updated response with the given status.

Returns an updated response with the given status.
raw docstring

textclj

(text ?msg)

Returns a skeletal response with the given msg, status of 200, and Content-Type set to text/plain.

Returns a skeletal response with the given msg, status of 200, and `Content-Type` set to `text/plain`.
raw docstring

update-headerclj

(update-header resp header-name f & args)

Looks up a header in a response (or request) case insensitively, then updates the header with the supplied function and arguments in the manner of update-in.

Looks up a header in a response (or request) case insensitively,
then updates the header with the supplied function and arguments in the
manner of update-in.
raw docstring

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

× close