You can definately send SLD-POST requests to geoserver:
1. with the SLD_BODY= in the URL
2. use ogc/soap-like XML request (like for wfs) with a <GetMap> XML
request
3. you can also do a hybrid of the (1) and (2) - stick all your
parameters in the URL and then stick the SLD XML in the POST body.
4. you can also do an 'indirect' SLD with an SLD=<url to SLD document>
The problem is that <IMG> tags in HTML *only* do GET requests, so you
cannot get it to make a POST this way. AJAX techniques are great for
doing the requests (ie. #2 or #3 above) but you cannot do anything with
the PNG/GIF/JPEG that geoserver returns.
This is extreamly annoying. Gabriel and I had a discussion about this a
while ago - the plan was to send a request for, say, xml/png instead of
image/png and geoserver would then send back a response something like
this:
<GetMapLocation>
...URL...
</GetMapLocation>
Where the given URL will be a simple GET request, for example something
like this:
localhost:8080/geoserver/wms?request=getmap&tag=823742032724023750
When you made the original (XML POST) request, geoserver would have
either:
1. saved a copy of the SLD and parameters so it can render the image
OR
2. rendered the image and temporarily saved a copy of it.
This way when you make the 2nd (GET) request, you'll get the image you
were looking for.
This integrates quite well into an AJAX application. You send off an
AJAX (XML POST) request to the server, have the browser (automatically)
process the simple response, then set the <IMG> tag's SRC to the URL
returned by geoserver. Simple.
Gabriel said he was thinking of implementing something like this, but I
dont know the status. You should file a jira task for this as its a
really useful addition for AJAX applications doing SLD-POST.
Unfortunately, its non-standard, but the standard is lacking.
dave
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/