If I look at the Swagger page for the POST /rest/layers/{layer}/styles endpoint, it suggests a styleBody in the format:
If I send a styleBody in that format I get an HTTP 500 error:
The endpoint works if I send a styleBody in application/json format similar to:
Note: The same issue came up in StackExchange here:https://gis.stackexchange.com/questions/375360/unable-to-associate-style-with-layer
The documentation shows an example of XML body with "<style>", StyleInfoPost is just the name of the parameter in the Swagger specification, it's not the root of the XML .
If I look at the Swagger page for the POST /rest/layers/{layer}/styles endpoint, it suggests a styleBody in the format:
If I send a styleBody in that format I get an HTTP 500 error:
The endpoint works if I send a styleBody in application/json format similar to:
Note: The same issue came up in StackExchange here:
https://gis.stackexchange.com/questions/375360/unable-to-associate-style-with-layer