Skip to content

Instantly share code, notes, and snippets.

@steinarb
Created March 12, 2022 09:28
Show Gist options
  • Save steinarb/655b632c5f453f0d92bf346a1ac3f96a to your computer and use it in GitHub Desktop.
Save steinarb/655b632c5f453f0d92bf346a1ac3f96a to your computer and use it in GitHub Desktop.
Hook function to save GET body from restclient.el
;;; -*- lexical-binding: t; -*-
(require 'restclient-jq)
(defun restclient-save-body (args args-offset)
(save-match-data
(let ((filename (expand-file-name args)))
(lambda ()
(with-current-buffer restclient-same-buffer-response-name
(write-region (point-min) (restclient-jq-result-end-point) filename))))))
(provide 'sb-restclient)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment