MapServer CGI won't work when using a POST request

Jason M Sievers j_siever at YAHOO.COM
Sat May 12 13:26:08 PDT 2007


I am using version 4.9cvs(FWTools1.3.0) of the CGI MapServer.  I
am able to send an HTTP GET request and get a map image from the MapServer
CGI just fine.  However I am not able to get this to work using a POST
request.  The error I get is 'loadMap(): Web application error.  CGI
variable "map" is not set.'  Code listings are below.

if (window.XMLHttpRequest) var oReq = new XMLHttpRequest();
else if (window.ActiveXObject) var oReq = new
ActiveXObject('Microsoft.XMLHTTP');

oReq.open('POST', '../mapserver/FWTools1.3.0/bin/mapserv.exe', true);
//oReq.open('GET',
'../mapserver/FWTools1.3.0/bin/mapserv.exe?mode=browse&map=bas.map&layers=all');
oReq.onreadystatechange = function()
{
  if (oReq.readyState != 4) return;
  if (oReq.staus == 200) alert(oReq.responseText);
  else alert('A problem occurred while processing your request.');
}
oReq.send('mode=browse&map=bas.map&layers=all');
//oReq.send(null);


The lines I've commented out are for the GET request that works.  Any
thoughts are greatly appreciated.

Thanks for any help,


Jason Sievers
j_siever at yahoo.com



More information about the MapServer-users mailing list