Function: verb-handler-json

verb-handler-json is a natively compiled function defined in verb.el.

Signature

(verb-handler-json)

Documentation

Standard handler for the "application/json" text content type.

Source Code

;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(defun verb-handler-json ()
  "Standard handler for the \"application/json\" text content type."
  (when verb-json-use-mode
    (funcall verb-json-use-mode))
  (when (< (buffer-size)
           (or verb-json-max-pretty-print-size 0))
    (unwind-protect
        (unless (zerop (buffer-size))
          (let ((json-pretty-print-max-secs 0)
                (json-key-type 'string))
            (buffer-disable-undo)
            (json-pretty-print-buffer)
            ;; "Use" `json-pretty-print-max-secs' here to avoid
            ;; byte-compiler warning in Emacs 26.
            json-pretty-print-max-secs))
      (buffer-enable-undo))
    (goto-char (point-min))))