Change how request input is processed.First the input is no longer json encode, All the get variables are loaded, then the post variables if the request is a post, and then the path is extracted from the uri.

This commit is contained in:
Tim Almdal
2009-12-18 14:59:44 -08:00
parent c804279647
commit 2e221a84cc

View File

@@ -68,17 +68,13 @@ class Rest_Controller extends Controller {
private function _normalize_request($args=array()) {
$method = strtolower($this->input->server("REQUEST_METHOD"));
$request = new stdClass();
foreach (array_keys($this->input->get()) as $key) {
$request->$key = $this->input->get($key);
}
if ($method != "get") {
$request = $this->input->post("request", null);
if ($request) {
$request = json_decode($request);
} else {
$request = new stdClass();
}
} else {
$request = new stdClass();
foreach (array_keys($this->input->get()) as $key) {
$request->$key = $this->input->get($key);
foreach (array_keys($this->input->post()) as $key) {
$request->$key = $this->input->post($key);
}
}