0
1
Fork 0
hedera-web-mindshore/vn/web/http-request.php

43 lines
521 B
PHP
Raw Normal View History

2016-07-22 20:00:27 +00:00
<?php
namespace Vn\Web;
require_once (__DIR__.'/rest-app.php');
/**
* Base class for rest services.
**/
class HttpRequest extends \Vn\Lib\Method
{
function listen ()
{
try {
$this->run ();
}
catch (SessionExpiredException $e)
{
$this->httpError (403);
}
catch (BadLoginException $e)
{
$this->httpError (401);
}
catch (Exception $e)
{
$this->httpError (400);
}
}
function httpError ($code)
{
}
function setError ($message, $code)
{
http_response_code (400);
}
}
?>