diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 00:00:48 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 00:02:29 +0000 |
commit | e731fd754cb4d5ef7e0d5d7e094a98b4162cba61 (patch) | |
tree | 306fd5c1cab423fee11d89a1170c1f090fa5262a /sx-request.el | |
parent | f26a55ce664d1840efef36079ab3634394006c5b (diff) |
Remove need-auth from sx-request--build-keyword-arguments
Diffstat (limited to 'sx-request.el')
-rw-r--r-- | sx-request.el | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sx-request.el b/sx-request.el index a98af5a..6be363d 100644 --- a/sx-request.el +++ b/sx-request.el @@ -91,9 +91,8 @@ number of requests left every time it finishes a call." ;;; Making Requests -(defun sx-request-make - (method &optional args request-method) - "Make a request to the API, executing METHOD with ARGS. +(defun sx-request-make (method &optional args request-method) + "Make a request to the API, executing METHOD with ARGS. You should almost certainly be using `sx-method-call' instead of this function. REQUEST-METHOD is one of `GET' (default) or `POST'. @@ -116,8 +115,7 @@ then read with `json-read-from-string'. the main content of the response is returned." (let* ((url-automatic-caching t) (url-inhibit-uncompression t) - (url-request-data (sx-request--build-keyword-arguments args - nil)) + (url-request-data (sx-request--build-keyword-arguments args nil)) (request-url (concat sx-request-api-root method)) (url-request-method request-method) (url-request-extra-headers @@ -168,15 +166,11 @@ Currently returns nil." ;;; Support Functions - -(defun sx-request--build-keyword-arguments (alist &optional - kv-sep need-auth) +(defun sx-request--build-keyword-arguments (alist &optional kv-sep) "Format ALIST as a key-value list joined with KV-SEP. If authentication is needed, include it also or error if it is not available. -If NEED-AUTH is non-nil, authentication is required. - Build a \"key=value&key=value&...\"-style string with the elements of ALIST. If any value in the alist is nil, that pair will not be included in the return. If you wish to pass a notion of @@ -185,7 +179,7 @@ false, use the symbol `false'. Each element is processed with ;; Add API key to list of arguments, this allows for increased quota ;; automatically. (let ((api-key (cons "key" sx-request-api-key)) - (auth (car (sx-cache-get 'auth)))) + (auth (car (sx-cache-get 'auth)))) (push api-key alist) (when auth (push auth alist)) |