branch: externals/srht commit e17edd764338a366abe0b2f78e34afd39e919d84 Author: Aleksandr Vityazev <avitya...@posteo.org> Commit: Aleksandr Vityazev <avitya...@posteo.org>
Add README. * srht: Add comments. (srht--api-request): Fix. --- README.md | 8 ++++++++ README.org | 5 +++++ srht.el | 5 +++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md new file mode 100644 index 0000000000..f75466b07e --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ + + +### Version 0.1.0 + + +# About + +GNU Emacs [sourcehut](https://sr.ht) API client. diff --git a/README.org b/README.org new file mode 100644 index 0000000000..c5585fda0c --- /dev/null +++ b/README.org @@ -0,0 +1,5 @@ +#+OPTIONS: toc:nil +*** Version 0.1.0 + +* About +GNU Emacs [[https://sr.ht][sourcehut]] API client. diff --git a/srht.el b/srht.el index 2748826a00..c27309a97a 100644 --- a/srht.el +++ b/srht.el @@ -23,7 +23,7 @@ ;; along with this program. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: -;; comment +;; https://man.sr.ht/api-conventions.md ;; ;;; Code: @@ -95,6 +95,7 @@ narrowed to the response body." (json-array-type 'list)) (json-read))) +;; TODO add body-type to use with `multipart/from-data' (cl-defun srht--api-request (method &key service path query body (else #'srht--else) form (then 'sync) (as #'srht--as) @@ -119,7 +120,7 @@ THEN is a callback function, which is called in the response data. ELSE is an optional callback function called when the request fails with one argument, a `plz-error' struct." (let ((uri (srht--make-uri service path query)) - (content-type (if form "multipart-form-data" "application/json"))) + (content-type (if form "multipart/form-data" "application/json"))) (plz method uri :headers `(,(cons "Content-Type" content-type) ,(cons "Authorization" (concat "token " srht-token)))