protected request ( string $uri, array $parameters = [], string $method = 'GET', array $server = [], array $files = [] ) : array | string | ||
$uri | string | A request uri |
$parameters | array | optional Request parameters |
$method | string | optional HTTP Request method |
$server | array | optional Additional server options |
$files | array | optional Uploaded files array |
리턴 | array | string | Returns array which represents returned json object or raw body content in the case if the responce is not a json. |
protected function request($uri, array $parameters = array(), $method = 'GET', array $server = array(), array $files = array())
{
$aUri = parse_url($uri);
call_user_func_array(array($this, 'getRequest'), array_merge(array(Scalr_UI_Request::REQUEST_TYPE_UI, null), func_get_args()));
$path = explode('/', trim($aUri['path'], '/'));
Scalr_UI_Controller::handleRequest($path);
$content = Scalr_UI_Response::getInstance()->getResponse();
$arr = @json_decode($content, true);
return $arr === null ? $content : $arr;
}