return [array_values($title),$nav];
}
- public function method_post_accept_decode($type=null) {
+ public function method_post_accept_decode($content_type=null) {
if ( empty($_SERVER['REQUEST_METHOD']) or $_SERVER['REQUEST_METHOD'] != 'POST' ) return;
- if (empty($type)) $type = self::client_content_type();
+ if (empty($content_type)) $content_type = self::client_content_type();
$raw = null;
+ #debug([self::client_header('Accept'),$content_type]);
foreach (['json','yaml'] as $type) {
- if (!strpos($type,'/'.$type)) continue;
- if ($raw) $_POST = [ $type => $raw ];
- if (empty($_POST[$type])) continue;
- #bye($_POST);
- $post = $_POST;
-
- unset($post[$type]);
+ if (!strpos($content_type,'/'.$type)) continue;
+# NB 20.07.18 if ($raw) $_POST = [ $type => $raw ];
+# NB 20.07.18 if (empty($_POST[$type])) continue;
+# NB 20.07.18 #bye($_POST);
+# NB 20.07.18 $post = $_POST;
+# NB 20.07.18
+# NB 20.07.18 unset($post[$type]);
$fct = $type . '_decode';
- $_POST = array_merge((array)$this->$fct($_POST[$type]),$post);
+ $_POST = $this->$fct(file_get_contents("php://input"));
+# NB 20.07.18 $_POST = array_merge((array)$this->$fct($_POST[$type]),$post);
break;
}
} elseif ($action == 'conf') { $this->page($this,'conf');
#} elseif ($action == 'html_video') { $this->page($arg);
} elseif ($action == 'html_video') { $this->page(Mime::html_video($arg));
+ } elseif ($action == '_post') { $this->page($_POST);
+ } elseif ($action == '_get') { $this->page($_GET);
+
} elseif ($action == 'types') {
$types = [];
foreach (array_keys($this->db->out->types()) as $type) {