Compat with API change (only POST allowed)

This commit is contained in:
Jaidyn Ann 2020-08-27 10:46:58 -05:00
parent 32306135bb
commit 470dbd0225
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
(defsystem "cl-ipfs-api2" (defsystem "cl-ipfs-api2"
:version "0.5" :version "0.51"
:license "GPLv3" :license "GPLv3"
:author "Jaidyn Ann <jadedctrl@teknik.io>" :author "Jaidyn Ann <jadedctrl@teknik.io>"
:description "Bindings for the IPFS HTTP API." :description "Bindings for the IPFS HTTP API."

View File

@ -21,7 +21,7 @@
;; STRING LIST [:LIST :BOOLEAN :SYMBOL] → STRING | HASHTABLE | (NIL STRING) ;; STRING LIST [:LIST :BOOLEAN :SYMBOL] → STRING | HASHTABLE | (NIL STRING)
(defun ipfs-call (call arguments &key (parameters nil) (want-stream nil) (defun ipfs-call (call arguments &key (parameters nil) (want-stream nil)
(method :GET)) (method :POST))
"Make an IPFS HTTP API call. Quite commonly used. "Make an IPFS HTTP API call. Quite commonly used.
Some calls return strings/raw data, and others return JSON. Some calls return strings/raw data, and others return JSON.
When strings/arbitrary data are recieved, they're returned verbatim. When strings/arbitrary data are recieved, they're returned verbatim.
@ -99,7 +99,7 @@
/ipns/docs.ipfs.io/reference/api/http/#api-v0-add" /ipns/docs.ipfs.io/reference/api/http/#api-v0-add"
(bind-api-result (bind-api-result
(ipfs-call "add" `(("pin" ,pin) ("only-hash" ,only-hash)) (ipfs-call "add" `(("pin" ,pin) ("only-hash" ,only-hash))
:method :post :parameters `(("file" . ,pathname))) :parameters `(("file" . ,pathname)))
result)) result))
;; STRING :NUMBER :NUMBER → STRING || (NIL STRING) ;; STRING :NUMBER :NUMBER → STRING || (NIL STRING)
@ -237,7 +237,7 @@
("mhtype" ,mhtype) ("mhtype" ,mhtype)
("mhlen" ,mhlen) ("mhlen" ,mhlen)
("pin" ,pin)) ("pin" ,pin))
:method :POST :parameters `(("data" . ,pathname))))) :parameters `(("data" . ,pathname)))))
;; STRING → NIL ;; STRING → NIL
(defun block-rm (hash &key (force nil)) (defun block-rm (hash &key (force nil))
@ -587,7 +587,7 @@
,(if count (list "count" count)) ,(if count (list "count" count))
,(if cid-version `("cid-version" ,cid-version)) ,(if cid-version `("cid-version" ,cid-version))
,(if hash (list "hash" hash))) ,(if hash (list "hash" hash)))
:method :post :parameters `(("file" . ,pathname))) :parameters `(("file" . ,pathname)))
result)) result))