Skip to content

Commit afb10e9

Browse files
committed
Show examples using POST, mention that GET is sometimes supported (#134)
1 parent 0432416 commit afb10e9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

content/developer/ejabberd-api/simple-configuration.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,26 @@ Access is thus generally limited by IP addresses, either restricted to localhost
4343
!!! note
4444
The `stop` and `start` commands are disabled in that example as they are usually restricted to the [ejabberdctl](../../admin/guide/managing.md#ejabberdctl) command-line tool. They are considered too sensitive to be exposed through API.
4545

46-
3. Now you can query the API, for example:
46+
3. Now you can query the API:
4747

48+
- Example using `POST` query:
49+
``` sh
50+
curl -X POST \
51+
-H "Content-type: application/json" \
52+
"127.0.0.1:5281/api/registered_users" \
53+
-d '{"host": "localhost"}'
54+
55+
["user2","user8"]
56+
```
57+
58+
- Minimal example using `POST`:
59+
``` sh
60+
curl 127.0.0.1:5281/api/registered_users -d '{"host": "localhost"}'
61+
62+
["user2","user8"]
63+
```
64+
65+
- `GET` is also supported when the arguments are just string or integers:
4866
``` sh
4967
curl '127.0.0.1:5281/api/registered_users?host=localhost'
5068

0 commit comments

Comments
 (0)