diff options
author | Sean Allred <code@seanallred.com> | 2015-01-04 15:21:55 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-01-04 15:21:55 -0500 |
commit | 1b5fd39d84cfc3138c2619631eebe508e7a0c2f9 (patch) | |
tree | dc4b74ed834aadc5992e92419f5247eb0408a7a4 | |
parent | d20f7e140d33b230cdaddd08cc6e2dfe75fd1e2b (diff) |
Use symbols for url-request-method
-rw-r--r-- | sx-compose.el | 4 | ||||
-rw-r--r-- | sx-interaction.el | 6 | ||||
-rw-r--r-- | sx-method.el | 6 | ||||
-rw-r--r-- | sx-request.el | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sx-compose.el b/sx-compose.el index d27d2f3..8a8637b 100644 --- a/sx-compose.el +++ b/sx-compose.el @@ -188,7 +188,7 @@ respectively added locally to `sx-compose-before-send-hook' and (.comment_id 'comments) (t 'answers)) :auth 'warn - :url-method "POST" + :url-method 'post :filter sx-browse-filter :site site :keywords (sx-compose--generate-keywords is-question) @@ -196,7 +196,7 @@ respectively added locally to `sx-compose-before-send-hook' and :submethod 'edit))) (lambda () (sx-method-call 'questions :auth 'warn - :url-method "POST" + :url-method 'post :filter sx-browse-filter :site site :keywords (sx-compose--generate-keywords is-question) diff --git a/sx-interaction.el b/sx-interaction.el index 80c8e5a..a72b14c 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -202,7 +202,7 @@ With the UNDO prefix argument, unfavorite the question instead." :submethod (if undo 'favorite/undo 'favorite) :auth 'warn :site .site_par - :url-method "POST" + :url-method 'post :filter sx-browse-filter))) (defalias 'sx-star #'sx-favorite) @@ -241,7 +241,7 @@ changes." :id (or .comment_id .answer_id .question_id) :submethod (concat type (unless status "/undo")) :auth 'warn - :url-method "POST" + :url-method 'post :filter sx-browse-filter :site .site_par)))) ;; The api returns the new DATA. @@ -282,7 +282,7 @@ TEXT is a string. Interactively, it is read from the minibufer." :id (or .post_id .answer_id .question_id) :submethod "comments/add" :auth 'warn - :url-method "POST" + :url-method 'post :filter sx-browse-filter :site .site_par :keywords `((body . ,text))))) diff --git a/sx-method.el b/sx-method.el index e68a4ea..bff6d30 100644 --- a/sx-method.el +++ b/sx-method.el @@ -39,7 +39,7 @@ (pagesize 100) (filter '(())) auth - (url-method "GET") + (url-method 'get) get-all (process-function #'sx-request-response-get-items) @@ -53,7 +53,7 @@ user. :FILTER is the set of filters to control the returned information :AUTH defines how to act if the method or filters require authentication. -:URL-METHOD is either \"POST\" or \"GET\" +:URL-METHOD is either `post' or `get' :SITE is the api parameter specifying the site. :GET-ALL is nil or non-nil :PROCESS-FUNCTION is a response-processing function @@ -102,7 +102,7 @@ Return the entire response as a complex alist." (format "/%s" submethod)) ;; On GET methods site is buggy, so we ;; need to provide it as a url argument. - (when (and site (string= url-method "GET")) + (when (and site (eq url-method 'get)) (prog1 (format "?site=%s" site) (setq site nil))))) diff --git a/sx-request.el b/sx-request.el index b2aee5d..bab53ec 100644 --- a/sx-request.el +++ b/sx-request.el @@ -134,7 +134,7 @@ access the response wrapper." (defun sx-request-make (method &optional args request-method process-function) "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'. +this function. REQUEST-METHOD is one of `get' (default) or `post'. Returns the entire response as processed by PROCESS-FUNCTION. This defaults to `sx-request-response-get-items'. @@ -158,7 +158,7 @@ the main content of the response is returned." (url-inhibit-uncompression t) (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-method (and request-method (symbol-name request-method))) (url-request-extra-headers '(("Content-Type" . "application/x-www-form-urlencoded"))) (response-buffer (url-retrieve-synchronously request-url))) |