ryoakg
7/16/2016 - 1:04 AM

run-curl-on-save.el

;;; Web API実装中の確認とかに使う

(make-local-variable 'my/curl-command)

;; 必用が出れば書換えて eval
(setq my/curl-command
 "curl \
 -Ss \
 -c cookie.txt -b cookie.txt \
 -X POST \
 -H 'Content-type: application/json' \
 -H 'X-login-id: hoge' \
 -H 'X-password: hoge' \
 --data '[{\"x\":1,\"y\":2}]' \
 http://localhost:8888/api/")

(add-hook 'after-save-hook
  '(lambda () (shell-command my/curl-command))
  t ; append
  t ; local
  )