mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
POST /... appends all array elements
parent
8738e6ee97
commit
9801536787
@ -345,15 +345,30 @@ $ curl "http://localhost:2019/config/apps/http/servers/myserver/listen"
|
||||
|
||||
Changes Caddy's configuration at the named scope to the JSON body of the request. If the named scope is an array, POST appends; if an object, it creates or replaces.
|
||||
|
||||
### Example
|
||||
As a special case, many items can be added to an array if:
|
||||
|
||||
1. the path ends in `/...`
|
||||
2. the second-to-last element of the path refers to an array
|
||||
3. the payload is an array
|
||||
|
||||
In this case, the elements in the payload's array will be expanded, and each one will be appended to the destination array.
|
||||
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
$ curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '":2080"' \
|
||||
-d '":8080"' \
|
||||
"http://localhost:2019/config/apps/http/servers/myserver/listen"
|
||||
```
|
||||
|
||||
```bash
|
||||
$ curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '[":8080", ":5133"]' \
|
||||
"http://localhost:2019/config/apps/http/servers/myserver/listen/..."
|
||||
```
|
||||
|
||||
|
||||
## PUT /config/[scope]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user