Hello, I'm trying to implement a GetFeatureInfo request using HTTP POST with
the data in JSON format.
Instead of doing something like:
$http.get('http://geoserver/
<http://geoserver/GetFeatureInfo&service=WMS&version=1.1.1&BBOX=-9.268684387
207031%2C38.697769425719144%2C-9.048957824707031%2C38.78580303175891&width=2
560&height=1315&query_layers=Pingo+Doce%2CTarget+ACP&layers=Pingo+Doce%2CTar
get+ACP&info_format=application%2Fjson&feature_count=50&x=1476&y=579&cql_fil
ter=(1%3D1)%3B(whatever+%3E+100)>
GetFeatureInfo&service=WMS&version=1.1.1&BBOX=-9.268684387207031%2C38.697769
425719144%2C-9.048957824707031%2C38.78580303175891&width=2560&height=1315&qu
ery_layers=Pingo+Doce%2CTarget+ACP&layers=Pingo+Doce%2CTarget+ACP&info_forma
t=application%2Fjson&feature_count=50&x=1476&y=579&cql_filter=(1%3D1)%3B(wha
tever+%3E+100)');
I want to be doing a POST request as such:
$http.post(url,
{
request: 'GetFeatureInfo',
service: 'WMS',
version: '1.1.1',
BBOX: bbox,
width: width,
height: height,
query_layers: layersString,
layers: layersString,
info_format: 'application/json',
feature_count: '50',
x: x,
y: y,
cql_filter: filtersString
},
{"headers" : { "Content-Type" : "application/json; charset=UTF-8" }
});
However, it appears that GeoServer is expecting a XML input or something,
the response I get is:
<ows:ExceptionText>org.xmlpull.v1.XmlPullParserException: only whitespace
content allowed before start tag and not - (position: START_DOCUMENT seen
-... @1:1)
only whitespace content allowed before start tag and not - (position:
START_DOCUMENT seen -... @1:1) </ows:ExceptionText>
</ows:Exception>
Is it not possible to make a POST request with JSON data? :(
Thanks in advance and sorry if I wasn't very clear.
Cosme Benito
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users