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.
sourceraw 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.
sourceraw 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.
sourceraw 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.
sourceraw docstring

credentialsclj

(credentials resp ?creds)
source

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.
sourceraw 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.
sourceraw docstring

(header resp ?name value)

Returns an updated response with the specified header added.

Returns an updated response with the specified header added.
sourceraw 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`.
sourceraw docstring

not-foundclj

(not-found body)

Returns a 404 'not found' response.

Returns a 404 'not found' response.
sourceraw docstring

originclj

(origin resp ?origin)
source

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
sourceraw docstring

redirect-status-codesclj

Map a keyword to a redirect status code.

Map a keyword to a redirect status code.
sourceraw 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.
sourceraw docstring

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

Sets a cookie on the response.

Sets a cookie on the response.
sourceraw docstring

statusclj

(status ?status)
(status resp ?status)

Returns an updated response with the given status.

Returns an updated response with the given status.
sourceraw 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`.
sourceraw 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.
sourceraw docstring

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

× close