diff options
Diffstat (limited to 'sx-method.el')
-rw-r--r-- | sx-method.el | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sx-method.el b/sx-method.el index e9c4f60..8909a2b 100644 --- a/sx-method.el +++ b/sx-method.el @@ -19,7 +19,10 @@ ;;; Commentary: -;; +;;; This file is effectively a common-use wrapper for +;;; `sx-request-make'. It provides higher-level handling such as +;;; (authentication, filters, ...) that `sx-request-make' doesn't need +;;; to handle. ;;; Code: (require 'json) @@ -29,8 +32,9 @@ (require 'sx-filter) (defun sx-method-call - (method &optional keyword-arguments filter need-auth use-post silent) + (method &optional keyword-arguments filter need-auth use-post) "Call METHOD with KEYWORD-ARGUMENTS using FILTER. +This is a high-level wrapper for `sx-request-make'. If NEED-AUTH is non-nil, an auth-token is required. If 'WARN, warn the user `(user-error ...)' if they do not have an AUTH @@ -39,18 +43,11 @@ token set. If USE-POST is non-nil, use `POST' rather than `GET' for passing arguments. -If SILENT is non-nil, no messages will be printed. - -Return the entire response as a complex alist." - (sx-request-make - method - (cons (cons 'filter - (sx-filter-get-var - (cond (filter filter) - ((boundp 'stack-filter) stack-filter)))) +Return the response content as a complex alist." + (sx-request-make method + (cons (cons 'filter (sx-filter-get-var filter)) keyword-arguments) - need-auth - use-post)) + need-auth use-post)) (provide 'sx-method) ;;; sx-method.el ends here |