Example #1
0
 public function request(Request $request)
 {
     $method = $request->getMethod();
     $parameters = $request->getParameters();
     $this->setUri($request->getUri());
     if (!strcasecmp($method, Request::GET)) {
         $this->setParameterGet($parameters);
     } else {
         if (!strcasecmp($method, Request::POST)) {
             $this->setParameterPost($parameters);
         }
     }
     if ($request->hasHttpBasicAuthenticationCredentials()) {
         $credentials = $request->getHttpBasicAuthenticationCredentials();
         $this->setAuth($credentials->getUsername(), $credentials->getPassword());
     }
     $timer = new Timer();
     $this->setMethod($method);
     $response = $this->send();
     $duration = $timer->stop();
     return new \Base\Http\Response\Zend($response, $duration);
 }