curl 命令在 CQ 中特定节点的多值属性中添加值

ris*_*wal 4 curl crx aem

我有一个特定的节点,例如:/content/site/advisors/jcr:content,它由属性“cq:allowed templates”组成,其值由多个字符串值(字符串数组)组成。我想添加另一个字符串值到它使用curl命令。请建议。 在此输入图像描述

Ber*_*taz 5

@PatchSling POST servlet 使用该后缀在多值属性中添加或删除值,例如:

$ curl -u admin:admin -Fmulti@TypeHint="String[]" -Fmulti=one -Fmulti=two -Fmulti=four http://localhost:8080/test
$ curl -u admin:admin -Fmulti@Patch="true" -Fmulti="+three" -Fmulti="-four" http://localhost:8080/test

$ curl http://localhost:8080/test.tidy.json
{
  "jcr:primaryType": "nt:unstructured",
  "multi": [
    "one",
    "two",
    "three"
  ]
  }
Run Code Online (Sandbox Code Playgroud)

该文档位于https://sling.apache.org/documentation/bundles/manipulated-content-the-slingpostservlet-servlets-post.html#patch