-
-
Save steinarb/fe442b78fda5d70a2733785c8c50e976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; restclient from git to get restclient-jq | |
(add-to-list 'load-path (expand-file-name "~/git/restclient.el")) | |
(when (locate-library "restclient") | |
(require 'restclient) | |
(require 'restclient-jq) | |
(restclient-register-result-func "save-body" #'restclient-save-body "Save body to filename given as arg")) | |
(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)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment