예제 #1
0
파일: index.php 프로젝트: sxhao/resty-1
<?php

define('DS', DIRECTORY_SEPARATOR);
define('APP_PATH', dirname(__FILE__) . DS);
define('SYS_PATH', realpath(dirname(__FILE__) . DS . '..' . DS . 'system') . DS);
define('RESOURCE_PATH', dirname(__FILE__) . DS . 'classes' . DS . 'resource' . DS);
require SYS_PATH . 'classes' . DS . 'resty' . DS . 'core.php';
require SYS_PATH . 'classes' . DS . 'resty.php';
Resty::instance()->init();
try {
    Request::instance()->exec()->output();
} catch (Route_Exception $e) {
    Response::instance()->set_status(404)->set_body(array('error' => 'Resource Not Found', 'Request' => $_SERVER['REQUEST_URI']))->output();
}
예제 #2
0
<?php

require 'vendor/.composer/autoload.php';
require "vendor/resty/resty/Resty.php";
$resty = new Resty();
$resty->debug(true);
$resty->setBaseURL('http://universidade.caixa/aplicacoes/trilhasDesenvolvimento/zUI/acesso_trilhas_ajax/');
$resp = $resty->get('?nu_trilha=332&acao=comparar&nu_usuario=C004397&data=01/01/2011');
var_dump($resp);