3

Not quite sure if I should even be doing this. What I am wanting is I will be dynamically generating my SLD file and it looks like when you update the SLD in the geoserver admin it does a reload. So I tried to do a reload using the rest API and curl and it does not appear to work.
Here is my Curl command:

curl -uadmin:password-XPOST http://localhost:8080/geoserver/rest/reload

If there is another way to clear everything so my SLD reloads that'd be awesome as well. Just needing to get this working and am not sure why it isn't.

2

How often are you doing this? For dynamic SLD files it is usually easier to send the SLD as part of the WMS request (i.e. use SLD not STYLES parameter) rather than changing the file on the server.

  • Just be aware that if you give users the possibility to override the SLD with the Get parameter (SLD=), any user can now load a very voluminous layer at a large scale and thus making your Geoserver instance less responsive. This can be disabled in the global WMS configuration. – Olyster Apr 17 '18 at 13:53
1

Which version of GeoServer are you using? If it is before 2.1 you need to manually install the restconfig extension. If 2.1 or later the extension should be installed by default.

I also agree with Ian in that if the the SLD is going to be constantly changing it might be nicer to just specify it on the fly.

  • well then that explains why it isn't working... Trying to get the sld to load on the file, I'm not having much luck. here is what I am doing and it is still loading the style from the wms. var tiled = new OpenLayers.Layer.WMS( "zip3 = Tiled", "http://localhost:8080/geoserver/wms", { layers:'tiger:zip3', styles: null }); map.addLayers([tiled]); tiled.mergeNewParams({sld :'http://localhost/styles/new.sld'}); – arkansasonline Mar 25 '11 at 21:31
0

There is the right syntax for curl REST request to reload geoserver:

curl -u admin:password -v -XPOST http://localhost:8080/geoserver/rest/reload

..Tested on Geoserver 2.10.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.