From 9b0d98000693e9eab357b7d91894715493b26487 Mon Sep 17 00:00:00 2001 From: Jordan Duabe Date: Wed, 18 Sep 2024 23:22:55 +0800 Subject: [PATCH] Add sample curl command for Windows --- README.md | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 24a774a..0724138 100644 --- a/README.md +++ b/README.md @@ -48,25 +48,34 @@ The [configuration](#configuration) section details how to retrieve the `API Key The `Command ID` can be obtained by calling the `/commands` endpoint of the Local REST API, through the command line or the [Local REST API playground](https://coddingtonbear.github.io/obsidian-local-rest-api). -Sample call to the commands endpoint using `curl`: +Sample call to the commands endpoint using `curl`, if you're running MacOS: ```bash - curl -X 'GET' \ - 'http://localhost:27123/commands/' \ - -H 'Accept: application/json' \ - -H 'Authorization: Bearer api_key_goes_here' +curl -X 'GET' \ + 'http://127.0.0.1:27123/commands/' \ + -H 'Accept: application/json' \ + -H 'Authorization: Bearer api_key_goes_here' + +# Sample response +{ + "commands": [ + { + "id": "app:open-help", + "name": "Open Help" + }, + ... + ] +} +``` - # Sample response - { - "commands": [ - { - "id": "app:open-help", - "name": "Open Help" - }, - ... - ] - } - ``` +If you're running Windows, run the following command: + +```powershell +curl -X "GET" ^ + "http://127.0.0.1:27123/commands/" ^ + -H "accept: application/json" ^ + -H "Authorization: Bearer api_key_goes_here" +``` ### Standard commands