Liking cljdoc? Tell your friends :D

ehr-adapter.http.header


->mimeclj

(->mime x)

acceptclj

(accept x)

Given a format keyword or Content-Type-Structured map, returns {"Accept" <mime-type>} or throws if the format is not supported.

Given a format keyword or Content-Type-Structured map, returns {"Accept" <mime-type>} or throws if the format is not supported.
raw docstring

authorizationclj

(authorization {:keys [token token-type]})

content-typeclj

(content-type x)

Given a format keyword or Content-Type-Structured map, returns {"Content-Type" <mime-type>} or throws if the format is not supported.

Given a format keyword or Content-Type-Structured map, returns {"Content-Type" <mime-type>} or throws if the format is not supported.
raw docstring

json-media-type?clj

(json-media-type? content-type)

Returns true if the given content-type value represents a JSON media type. Accepts either a keyword (e.g. :json, :fhir/json) or a structured map with a :code key.

Returns true if the given content-type value represents a JSON media type.
Accepts either a keyword (e.g. :json, :fhir/json) or a structured map with a :code key.
raw docstring

keyword-format->mimeclj


mime->keyword-formatclj


mime-errorclj

(mime-error x)

parse-mimeclj

(parse-mime s)

Parses a raw HTTP Content-Type header string into the internal structured map representation of the engine.

Always returns a map with a :code key, and optionally a :properties map if parameters are present in the header or if the media type is unsupported.

The returned map contains:

  • :code The unassigned format keyword, or :unsupported if not registered.
  • :properties An optional map of string key-value pairs representing parameters (e.g., charset, boundary). If the format is :unsupported, it includes a :raw-mime key containing the original parsed media type.

Examples: (parse-mime "application/json") => {:code :json}

(parse-mime "application/fhir+json; charset=utf-8") => {:code :fhir/json, :properties {"charset" "utf-8"}}

(parse-mime "application/x-custom-type; boundary=123") => {:code :unsupported, :raw-mime "application/x-custom-type" :properties {"boundary" "123"}}

Parses a raw HTTP Content-Type header string into the internal structured
map representation of the engine.

Always returns a map with a :code key, and optionally a :properties map
if parameters are present in the header or if the media type is unsupported.

The returned map contains:
- :code        The unassigned format keyword, or :unsupported if not registered.
- :properties  An optional map of string key-value pairs representing parameters
               (e.g., charset, boundary). If the format is :unsupported, it 
               includes a :raw-mime key containing the original parsed media type.

Examples:
  (parse-mime "application/json")
  => {:code :json}

  (parse-mime "application/fhir+json; charset=utf-8")
  => {:code :fhir/json, :properties {"charset" "utf-8"}}

  (parse-mime "application/x-custom-type; boundary=123")
  => {:code :unsupported, :raw-mime "application/x-custom-type" :properties {"boundary" "123"}}
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close