I have tried this (using PHP). However, when uses json_encode, the “params” of “versioning” seems not working.
Here is what I have done:
- in PHP, using curl -s -H X-API-Key:V0a06AIXjmSyHG4wj1Y5sifURCqbzPnR
-o config.json http://localhost:8385/rest/system/config and get the config.json
- in PHP, use json_decode to parse the file;
- without changing anything, use json_encode and write the result to another file config.json2;
- using curl -s -H X-API-Key:V0a06AIXjmSyHG4wj1Y5sifURCqbzPnR
-X POST --data-binary @config.json2 API_URL
to write it back
got the following error:
json: cannot unmarshal array into Go struct field VersioningConfiguration.params of type map[string]string
Looking into config.json2, it shows that:
However “params” should be an object? How to make it an object?