Liking cljdoc? Tell your friends :D

stub.shared


*call-counts*clj

source

*expected-counts*clj

source

*in-isolation*clj

source

*stub-routes*clj

source

address-string-forclj

(address-string-for request-map)

Converts a request map into a URL string. Handles both keyword (:http) and string ('http') schemes. Returns a string in the format: scheme://server-name:port/uri?query-string where each component is optional.

Converts a request map into a URL string.
Handles both keyword (:http) and string ('http') schemes.
Returns a string in the format: scheme://server-name:port/uri?query-string
where each component is optional.
sourceraw docstring

create-responseclj

(create-response response request)

Creates a response map with default values merged with the provided response. If response is a function, it will be called with the request as an argument. Returns a map with :status, :headers, and :body.

Creates a response map with default values merged with the provided response.
If response is a function, it will be called with the request as an argument.
Returns a map with :status, :headers, and :body.
sourceraw docstring

defaults-or-valueclj

(defaults-or-value defaults value)

Given a set of default values and a value, returns either:

  • a vector of all default values (reversed) if the value is in the defaults
  • a vector containing just the value if it's not in the defaults
Given a set of default values and a value, returns either:
- a vector of all default values (reversed) if the value is in the defaults
- a vector containing just the value if it's not in the defaults
sourceraw docstring

get-request-methodclj

(get-request-method request)

Gets the request method from either http-kit (:method) or clj-http (:request-method) style requests

Gets the request method from either http-kit (:method) or clj-http (:request-method) style requests
sourceraw docstring

get-request-query-paramsclj

(get-request-query-params request)

Extracts and normalizes query parameters from a request. Handles both :query-params and :query-string formats.

Extracts and normalizes query parameters from a request.
Handles both :query-params and :query-string formats.
sourceraw docstring

methods-match?clj

(methods-match? expected-method request)

Checks if a request method matches an expected method. Handles :any as a wildcard method.

Checks if a request method matches an expected method.
Handles :any as a wildcard method.
sourceraw docstring

normalize-pathclj

(normalize-path path)
source

normalize-query-paramsclj

(normalize-query-params params)

Normalizes query parameters to a consistent format. Handles both string and keyword keys, and converts all values to strings.

Normalizes query parameters to a consistent format.
Handles both string and keyword keys, and converts all values to strings.
sourceraw docstring

normalize-requestclj

(normalize-request request)

Normalizes a request map to a consistent format.

  • Converts string URLs to request maps
  • Sets default method to :get
  • Handles HttpEntity bodies
  • Ensures consistent method key (:method or :request-method)
Normalizes a request map to a consistent format.
- Converts string URLs to request maps
- Sets default method to :get
- Handles HttpEntity bodies
- Ensures consistent method key (:method or :request-method)
sourceraw docstring

normalize-url-for-matchingclj

(normalize-url-for-matching url)

Normalizes a URL string by removing trailing slashes for consistent matching

Normalizes a URL string by removing trailing slashes for consistent matching
sourceraw docstring

parse-query-stringclj

(parse-query-string query-string)

Parses a query string into a map of normalized parameters. Returns empty map for nil or empty query string.

Parses a query string into a map of normalized parameters.
Returns empty map for nil or empty query string.
sourceraw docstring

parse-urlclj

(parse-url url)

Parse a URL string into a map containing :scheme, :server-name, :server-port, :uri, and :query-string

Parse a URL string into a map containing :scheme, :server-name, :server-port, :uri, and :query-string
sourceraw docstring

potential-alternatives-toclj

(potential-alternatives-to request uris-fn)

Given a request map and a function to generate potential URIs, returns a sequence of all possible alternative request maps by combining different schemes, server ports, URIs, and query strings. Each alternative preserves all other fields from the original request.

The uris-fn parameter should be a function that takes a request map and returns a sequence of potential URIs for that request.

Given a request map and a function to generate potential URIs,
returns a sequence of all possible alternative request maps
by combining different schemes, server ports, URIs, and query strings.
Each alternative preserves all other fields from the original request.

The uris-fn parameter should be a function that takes a request map and returns
a sequence of potential URIs for that request.
sourceraw docstring

potential-query-strings-forclj

(potential-query-strings-for request-map)

Given a request map, returns a vector of potential query strings. If the request has no query string or an empty one, returns ['', nil]. If it has a query string, returns all possible permutations of its parameters.

Given a request map, returns a vector of potential query strings.
If the request has no query string or an empty one, returns ['', nil].
If it has a query string, returns all possible permutations of its parameters.
sourceraw docstring

potential-schemes-forclj

(potential-schemes-for request-map)

Given a request map, returns a vector of potential schemes. Handles both string ('http') and keyword (:http) schemes. If the request's scheme is http/nil, returns [http nil], otherwise returns a vector with just the specified scheme.

Given a request map, returns a vector of potential schemes.
Handles both string ('http') and keyword (:http) schemes.
If the request's scheme is http/nil, returns [http nil],
otherwise returns a vector with just the specified scheme.
sourceraw docstring

potential-server-ports-forclj

(potential-server-ports-for request-map)

Given a request map, returns a vector of potential server ports. If the request's server-port is 80 or nil, returns [80 nil], otherwise returns a vector with just the specified port.

Given a request map, returns a vector of potential server ports.
If the request's server-port is 80 or nil, returns [80 nil],
otherwise returns a vector with just the specified port.
sourceraw docstring

query-params-match?clj

(query-params-match? expected-query-params request)

Checks if the actual query parameters in a request match the expected ones. Works with both query-string and query-params formats, and handles both httpkit and clj-http parameter styles.

Checks if the actual query parameters in a request match the expected ones.
Works with both query-string and query-params formats, and handles both
httpkit and clj-http parameter styles.
sourceraw docstring

validate-all-call-countsclj

(validate-all-call-counts)
source

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

× close