[mapserver-users] WFS PHP Wrapper for POST body Request

Sven Schroeter schroeter at netgis.de
Thu Aug 15 08:05:33 PDT 2019


Hi,

I'm using a WFS Wrapper written in PHP with following Code (MS Version 7.x):
...

try {
         $oMap = ms_newMapobj($mymapfile);
     } catch (Exception $e) {
         echo '<strong>Exception:</strong> ', $e->getMessage(), "\n";
         ms_ioresethandlers();
         $oMap->free();
         unset($oMap);
         exit;
     }

     $request = ms_newowsrequestobj();


     foreach ($_GET as $k=>$v) {
         $request->setParameter($k, $v);
     }

     foreach ($_POST as $k=>$v) {
         $request->setParameter($k, $v);
     }

     $oMap->owsdispatch($request);
     $contenttype = ms_iostripstdoutbuffercontenttype();

     //Objekt reset
     $oMap->free();
     unset($oMap);

       $buffer = ms_iogetstdoutbufferstring();
       header('Content-Type: application/xml; charset=utf-8');
       echo $buffer;

...

this works fine with GET Request or Post Requests sent from a form.
I have a problem with data I send over the body of a POST request.
So I can get to the data and hand it over, but how?
$postBody = file_get_contents('php://input');

I've already tested it with
$request->loadparams();

Any idea?
Thanks Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190815/f8dba61f/attachment.htm>


More information about the MapServer-users mailing list