I am keeping an up to date ob-http fork
Just a FYI: I decided to merge most of the proposed changes to the fantastic ob-http in the fork I am maintaining for myself.
If you want a fresher ob-http, just run:
(unless (package-installed-p 'vc-use-package)
(package-vc-install "https://github.com/slotThe/vc-use-package"))
(use-package ob-http
:vc (:repo ag91/ob-http :fetcher github))
I recently wanted to customize ob-http and seen that there has been no further development from years so far, I thought to update my fork.
I added also a way to upload a local file with a new :upload-file
parameter to the source blocks:
#+BEGIN_SRC http :pretty :file :upload-file /tmp/my.txt
POST https://httpbin.org/anything
Content-Type: text/plain
Content-Disposition: attachment; filename="my.txt"
#+END_SRC
#+RESULTS:
#+begin_example
{
"args": {},
"data": "* Etiam vel tortor sodales tellus ultricies commodo.\n",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Content-Disposition": "attachment; filename=\"my.txt\"",
"Content-Length": "53",
"Content-Type": "text/plain",
"Host": "httpbin.org",
"User-Agent": "curl/7.81.0",
"X-Amzn-Trace-Id": "Root=1-668db1b3-0e94aefe3fd0945f08d2f2fb"
},
"json": null,
"method": "POST",
"origin": "81.132.246.180",
"url": "https://httpbin.org/anything"
}
#+end_example
Happy HTTP requesting!