Upload JSON object to KV

Is it possible to update KV using a local JSON file? My idea would be to update the file locally and call the enpoint kv.put to update the KV entries
2 Replies
Destrocamos
DestrocamosOP6mo ago
Thanks a lot fr your answer! It works but I was expecting to have a JSON object and the value and then retrieve it by the key but seems it does not see it as a valid JSON
❯ curl localhost:8787/releases/cenas-1 | jq

"{ \n \"fefe-hub\": {\n \"v2.3.4\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.3.4.zip\"\n },\n \"v2.2.1\": {\n \"type\": \"beta\",\n \"download_link\": \n\"https://example.com/-hub-beta-v2.2.1.zip\"\n },\n \"v2.4.5\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/--v2.4.5.zip\"\n }\n },\n \"fefef\": {\n \"v2.3.4\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.3.4.zip\"\n },\n \"v2.2.1\": {\n \"type\": \"beta\",\n \"download_link\": \n\"https://example.com/-hub-beta-v2.2.1.zip\"\n },\n \"v2.4.5\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.4.5.zip\"\n }\n }\n}"
❯ curl localhost:8787/releases/cenas-1 | jq

"{ \n \"fefe-hub\": {\n \"v2.3.4\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.3.4.zip\"\n },\n \"v2.2.1\": {\n \"type\": \"beta\",\n \"download_link\": \n\"https://example.com/-hub-beta-v2.2.1.zip\"\n },\n \"v2.4.5\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/--v2.4.5.zip\"\n }\n },\n \"fefef\": {\n \"v2.3.4\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.3.4.zip\"\n },\n \"v2.2.1\": {\n \"type\": \"beta\",\n \"download_link\": \n\"https://example.com/-hub-beta-v2.2.1.zip\"\n },\n \"v2.4.5\": {\n \"type\": \"release\",\n \"download_link\": \n\"https://example.com/-hub-v2.4.5.zip\"\n }\n }\n}"
Want results from more Discord servers?
Add your server