alphapapa / alphapapa/elexandria
Problem with url-with-retrieve-async
- Lingua principale
- Emacs Lisp
- Stelle
- 13
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I'm trying to see if I could [replace request.el with elexandria](https://gitlab.petton.fr/elcouch/libelcouch/tree/elexandria) but I failed. Current code is:
```emacs
(cl-defgeneric libelcouch-entity-list (entity function)
"Evaluate function with the children of ENTITY as parameter."
(request
(url-encode-url (libelcouch--entity-children-url entity))
:timeout libelcouch-timeout
:headers '(("Content-Type" . "application/json")
("Accept" . "application/json"))
:parser 'json-read
:success (cl-function
(lambda (&key data &allow-other-keys)
(let* ((children (libelcouch--entity-create-children-from-json entity data)))
(funcall function children))))
:error #'libelcouch--request-error)
nil)
```
while new code is
```emacs
(cl-defgeneric libelcouch-entity-list (entity function)
"Evaluate function with the children of ENTITY as parameter."
(url-with-retrieve-async
(url-encode-url (libelcouch--entity-children-url entity))
:timeout libelcouch-timeout
:extra-headers '(("Content-Type" . "application/json")
("Accept" . "application/json"))
:parser 'json-read
:success (cl-function
(lambda (&key data &allow-other-keys)
(let* ((children (libelcouch--entity-create-children-from-json entity data)))
(funcall function children))))
:error #'libelcouch--request-error)
nil)
```
The first one works fine but the second doesn't seem to do anything beyond "Contacting host: localhost:5984". The only things I changed are the function name and the `:headers` key (changed to `:extra-headers`. Is there anything else I should have changed?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.