https://www.osgeo.cn/geoserver-user-manual/rest/index.html#rest
python示例
# xml方式
auth = ('admin', 'geoserver')
response = requests.put('http://localhost:9090/geoserver/rest/layers/seaice:ice_thickness_1020',
headers={'Content-Type': 'application/xml'},
data=f"<layer><defaultStyle><name>seaice:wave</name></defaultStyle></layer>",
auth=auth)
# json方式
data = json.dumps({
"layer": {
"defaultStyle": {
"name": "seaice:wave"
}
}
})
response = requests.put('http://localhost:9090/geoserver/rest/layers/seaice:ice_thickness_1020',
headers={'Content-Type': 'application/json'},
data=data,
auth=auth)