Merge pull request #7 from davidshepherd7/patch-1
Clarify the documentation for people using something other than Javascript
This commit is contained in:
commit
c2842dda4f
16
README.md
16
README.md
@ -47,8 +47,8 @@ extensions) can then communicate with it via HTTP POST requests.
|
||||
|
||||
### Sample Invocation ###
|
||||
|
||||
Every request consists of an *action*, and a set of contextual *parameters*. A simple example of a JavaScript
|
||||
application communicating with the extension is illustrated below:
|
||||
Every request consists of a JSON-encoded object containing an *action*, and a set of contextual *parameters*.
|
||||
A simple example of a JavaScript application communicating with the extension is illustrated below:
|
||||
|
||||
```JavaScript
|
||||
function ankiInvoke(action, params={}) {
|
||||
@ -74,9 +74,19 @@ ankiInvoke('version').then(response => {
|
||||
});
|
||||
```
|
||||
|
||||
Or using [`curl`](https://curl.haxx.se):
|
||||
|
||||
```
|
||||
curl localhost:8765 -X POST -d '{"action": "version", "params": {}}'
|
||||
```
|
||||
|
||||
### Supported Actions ###
|
||||
|
||||
The following actions are currently supported:
|
||||
The following actions are currently supported.
|
||||
|
||||
Note that the sample requests are written here as Javascript objects rather than raw JSON.
|
||||
If you are writing raw requests be sure to send valid JSON (i.e. quote all keys and strings with
|
||||
`"`, and remove any comments).
|
||||
|
||||
* **version**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user