Small syntax sugar optimizations
This commit is contained in:
parent
ce0951fc45
commit
9d4bab5a20
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@
|
||||||
(defun mattermost-login (username password)
|
(defun mattermost-login (username password)
|
||||||
"Log into the Mattermost Server"
|
"Log into the Mattermost Server"
|
||||||
(let ((url-request-method "POST")
|
(let ((url-request-method "POST")
|
||||||
(url-request-extra-headers `(("Content-Type" . "application/json")))
|
(url-request-extra-headers '(("Content-Type" . "application/json")))
|
||||||
(url-request-data (json-serialize (list :login_id username :password password))))
|
(url-request-data (json-serialize (list :login_id username :password password))))
|
||||||
(with-current-buffer (url-retrieve-synchronously (concat mattermost-server-url "/api/v4/users/login"))
|
(with-current-buffer (url-retrieve-synchronously (concat mattermost-server-url "/api/v4/users/login"))
|
||||||
(beginning-of-buffer)
|
(beginning-of-buffer)
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
(url-request-extra-headers `(("Content-Type" . "application/json")))
|
(url-request-extra-headers `(("Content-Type" . "application/json")))
|
||||||
(url-request-data (if body (json-serialize body))))
|
(url-request-data (if body (json-serialize body))))
|
||||||
(if mattermost-token
|
(if mattermost-token
|
||||||
(add-to-list 'url-request-extra-headers (cons "Authorization" (concat "Bearer " mattermost-token))))
|
(add-to-list 'url-request-extra-headers `("Authorization" . ,(concat "Bearer " mattermost-token))))
|
||||||
(with-current-buffer (url-retrieve-synchronously (concat mattermost-server-url "/api/v4" url) t)
|
(with-current-buffer (url-retrieve-synchronously (concat mattermost-server-url "/api/v4" url) t)
|
||||||
(mattermost-parse-json))))
|
(mattermost-parse-json))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue