Example #1
0
 /**
  * Initialize this web request.
  * 
  * @return 
  */
 public function __construct()
 {
     parent::__construct();
     if (isset($_SERVER['REQUEST_METHOD'])) {
         switch ($_SERVER['REQUEST_METHOD']) {
             case 'GET':
                 $this->setMethod(self::GET);
                 break;
             case 'POST':
                 $this->setMethod(self::POST);
                 break;
             default:
                 $this->setMethod(self::GET);
         }
     } else {
         // set the default method
         $this->setMethod(self::GET);
     }
     // GET parameters
     $this->getParameters = get_magic_quotes_gpc() ? coreToolkit::stripslashesDeep($_GET) : $_GET;
     $this->parameterHolder->add($this->getParameters);
     // POST parameters
     $this->postParameters = get_magic_quotes_gpc() ? coreToolkit::stripslashesDeep($_POST) : $_POST;
     $this->parameterHolder->add($this->postParameters);
 }
Example #2
0
<?php

session_start();
include_once "../../lib/requestClass.php";
$vRQ = explode('/', trim($_SERVER['PATH_INFO'], '/'));
var_dump($vRQ);
$vRequest = $vRQ;
$vRequest['body'] = json_decode(file_get_contents('php://input'), true);
$vRequest['method'] = $_SERVER['REQUEST_METHOD'];
$request = new coreRequest($vRequest);
$response = $request->process();
header($response["http_rsp_code"]);
echo json_encode($response["proc_rsp_code"]);