diff --git a/v2:-Documentation.md b/v2:-Documentation.md index 7b9b932..f099c98 100644 --- a/v2:-Documentation.md +++ b/v2:-Documentation.md @@ -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]