Function: verb-request-spec-to-string

verb-request-spec-to-string is a byte-compiled function defined in verb.el.

Signature

(verb-request-spec-to-string &rest ARGS)

Implementations

(verb-request-spec-to-string (RS verb-request-spec)) in `verb.el'.

Return request spec RS as a string. This string should be able to be used with `verb-request-spec-from-string', yielding the same request spec again.

Source Code

;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(cl-defmethod verb-request-spec-to-string ((rs verb-request-spec))
  "Return request spec RS as a string.
This string should be able to be used with
`verb-request-spec-from-string', yielding the same request spec again."
  (with-temp-buffer
    (insert (oref rs method) " "
            (url-recreate-url (oref rs url)) "\n")
    (dolist (key-value (oref rs headers))
      (insert (car key-value) ": " (cdr key-value) "\n"))
    (when-let ((body (oref rs body)))
      (if-let* ((headers (oref rs headers))
                (lang (verb--get-src-block-lang headers)))
          (progn (insert "\n#+begin_src " lang "\n" body)
                 (when (not (looking-at-p "^$")) (insert "\n"))
                 (insert "#+end_src\n"))
        (insert "\n" body)))
    (verb--buffer-string-no-properties)))