Helpers for dealing with Ring requests and responses.
Helpers for dealing with Ring requests and responses.
(body-string request)
Retrieves a String representation of the request, using the request-encoding for byte deserialization. The input-stream body of the request will be consumed and will not be readable anymore.
Retrieves a String representation of the request, using the request-encoding for byte deserialization. The input-stream body of the request will be consumed and will not be readable anymore.
Defines the default encoding used by Ring middlewares.
Defines the default encoding used by Ring middlewares.
(request-base-uri request)
Retrieves the base URI (String) of the request, taking into account all X- headers. The base URI is basically the scheme://host:port of the request originally sent by the browser.
Retrieves the base URI (String) of the request, taking into account all X- headers. The base URI is basically the scheme://host:port of the request originally sent by the browser.
(request-bytes request)
Retrieves a byte-array representation of the request. The input-stream body of the request will be consumed and will not be readable anymore.
Retrieves a byte-array representation of the request. The input-stream body of the request will be consumed and will not be readable anymore.
(request-client-ip request)
Retrieves the IP address (String) of the client that sent the request, taking the X-Forwarded-For header into account.
Retrieves the IP address (String) of the client that sent the request, taking the X-Forwarded-For header into account.
(request-encoding request)
Retrieves the character encoding of the request, using the default-encoding if the request doesn't specify it.
Retrieves the character encoding of the request, using the default-encoding if the request doesn't specify it.
(request-id request)
Retrieves the unique ID of the request.
Retrieves the unique ID of the request.
(request-protocol request)
Retrieves the scheme (keyword) of the request, defaulting to HTTP/1.1 if the :protocol entry is absent.
Retrieves the scheme (keyword) of the request, defaulting to HTTP/1.1 if the :protocol entry is absent.
(request-scheme request)
Retrieves the scheme (keyword) of the request, taking the X-Forwarded-Proto header into account.
Retrieves the scheme (keyword) of the request, taking the X-Forwarded-Proto header into account.
(request-scheme-host-port request)
Retrieves a vector of [^keyword scheme ^String host ^Integer port] for the request, taking the X-Forwarded-Proto and X-Forwarded-Port headers into account.
Retrieves a vector of [^keyword scheme ^String host ^Integer port] for the request, taking the X-Forwarded-Proto and X-Forwarded-Port headers into account.
(response-bytes response)
Retrieves a byte-array representation of the response. If the response has an input-stream body, it will be consumed and will not be readable anymore.
Retrieves a byte-array representation of the response. If the response has an input-stream body, it will be consumed and will not be readable anymore.
(response-encoding response)
Retrieves the character encoding of the response, using the default-encoding if the request doesn't specify it.
Retrieves the character encoding of the response, using the default-encoding if the request doesn't specify it.
(response-size response)
Retrieves the size of the response. If the response does not contain a Content-Length headers, the size will be estimated from the body value. This estimated size may be inaccurate for streaming payload if their InputStream implementation returns an inaccurate value for calls to .available(). Returns a negative value if an issue occurred during the size calculation.
Retrieves the size of the response. If the response does not contain a Content-Length headers, the size will be estimated from the body value. This estimated size may be inaccurate for streaming payload if their InputStream implementation returns an inaccurate value for calls to .available(). Returns a negative value if an issue occurred during the size calculation.
(strip-charset media-type)
Removes the charset attribute of a media-type string, if present.
Removes the charset attribute of a media-type string, if present.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close