'Content-Type header missing.'
);
}
- $ctype = $_SERVER['CONTENT_TYPE'];
+ list($ctype) = explode(';', $_SERVER['CONTENT_TYPE'], 2);
+ $ctype = trim($ctype);
if ($ctype == 'application/x-www-form-urlencoded') {
if (!isset($_POST['action'])) {
$_POST['action'] = 'create';
$json = $base;
$json->properties = (object) $data;
handleCreate($json, $token);
- } else if ($ctype == 'application/javascript') {
- $input = file_get_contents('php://stdin');
+ } else if ($ctype == 'application/json') {
+ $input = file_get_contents('php://input');
$json = json_decode($input);
if ($json === null) {
mpError(