branch: externals/plz commit 701e79c3e8bcfe7d403ea772b274cf53c5ac32af Author: Adam Porter <a...@alphapapa.net> Commit: Adam Porter <a...@alphapapa.net>
Tidy: Remove obsolete functions --- plz.el | 81 ------------------------------------------------------------------ 1 file changed, 81 deletions(-) diff --git a/plz.el b/plz.el index e547a7f85f..680aadd73d 100644 --- a/plz.el +++ b/plz.el @@ -192,87 +192,6 @@ It is called without arguments outside the curl process buffer.") ;;;;; Public -(cl-defun plz-get (url &key headers as then else noquery - (connect-timeout plz-connect-timeout) - (decode t decode-s)) - "Get HTTP URL with curl. - -AS selects the kind of result to pass to the callback function -THEN. It may be: - -- `buffer' to pass the response buffer. -- `binary' to pass the response body as an undecoded string. -- `string' to pass the response body as a decoded string. -- `response' to pass a `plz-response' struct. -- A function, which is called in the response buffer with it - narrowed to the response body (suitable for, e.g. `json-read'). - -If DECODE is non-nil, the response body is decoded automatically. -For binary content, it should be nil. When AS is `binary', -DECODE is automatically set to nil. - -THEN is a callback function, whose sole argument is selected -above with AS. - -ELSE is an optional callback function called when the request -fails with one argument, a `plz-error' struct. If ELSE is nil, -an error is signaled when the request fails, either -`plz-curl-error' or `plz-http-error' as appropriate, with a -`plz-error' struct as the error data. - -HEADERS may be an alist of extra headers to send with the -request. CONNECT-TIMEOUT may be a number of seconds to timeout -the initial connection attempt. - -NOQUERY is passed to `make-process', which see." - (declare (indent defun)) - (plz--curl 'get url - :headers headers - :connect-timeout connect-timeout - :decode (if (and decode-s (not decode)) nil decode) - :as as :then then :else else :noquery noquery)) - -(cl-defun plz-put (url body &key headers as then else noquery - (connect-timeout plz-connect-timeout) - (decode t decode-s)) - "PUT BODY to URL with curl. - -AS selects the kind of result to pass to the callback function -THEN. It may be: - -- `buffer' to pass the response buffer. -- `binary' to pass the response body as an undecoded string. -- `string' to pass the response body as a decoded string. -- `response' to pass a `plz-response' struct. -- A function, which is called in the response buffer with it - narrowed to the response body (suitable for, e.g. `json-read'). - -If DECODE is non-nil, the response body is decoded automatically. -For binary content, it should be nil. When AS is `binary', -DECODE is automatically set to nil. - -THEN is a callback function, whose sole argument is selected -above with AS. - -ELSE is an optional callback function called when the request -fails with one argument, a `plz-error' struct. If ELSE is nil, -an error is signaled when the request fails, either -`plz-curl-error' or `plz-http-error' as appropriate, with a -`plz-error' struct as the error data. - -HEADERS may be an alist of extra headers to send with the -request. CONNECT-TIMEOUT may be a number of seconds to timeout -the initial connection attempt. - -NOQUERY is passed to `make-process', which see." - (declare (indent defun)) - (plz--curl 'put url - :body body - :headers headers - :connect-timeout connect-timeout - :decode (if (and decode-s (not decode)) nil decode) - :as as :then then :else else :noquery noquery)) - (cl-defun plz (method url &key headers body as then else finally noquery (body-type 'text) (connect-timeout plz-connect-timeout)