This repository was archived by the owner on May 30, 2024. It is now read-only.

Description
On the consul API if I query an existing endpoint for keys, I receive an empty list, whereas if I query a non-existent key, I receive HTTP 404.
Using the python library, however, I can't differentiate the two cases.
Examples
Existing but empty
$ curl http://.../v1/kv/?keys=True -v
...
> GET /v1/kv/?keys=True HTTP/1.1
...
< HTTP/1.1 200 OK
< Content-Type: application/json
< Vary: Accept-Encoding
< X-Consul-Default-Acl-Policy: allow
< X-Consul-Index: 74726
< X-Consul-Knownleader: true
< X-Consul-Lastcontact: 0
< X-Consul-Query-Backend: blocking-query
< Date: Thu, 03 Nov 2022 16:08:47 GMT
< Content-Length: 2
...
[]
>>> c.kv.get('', keys=True)
('74726', None)
Not existing
$ curl http://.../v1/kv/s/?keys=True -v
...
> GET /v1/kv/s/?keys=True HTTP/1.1
...
< HTTP/1.1 404 Not Found
< Vary: Accept-Encoding
< X-Consul-Default-Acl-Policy: allow
< X-Consul-Index: 74726
< X-Consul-Knownleader: true
< X-Consul-Lastcontact: 0
< X-Consul-Query-Backend: blocking-query
< Date: Thu, 03 Nov 2022 16:08:41 GMT
< Content-Length: 0
>>> c.kv.get('s/', keys=True)
('74726', None)