示例#1
0
文件: index.php 项目: juckerf/sshAkD
}
switch ($method) {
    case 'DELETE':
        if (strlen($id) > 1) {
            /* delete object from database $db->delete($endpoint,$id);*/
        } else {
            /* return error */
        }
        break;
    case 'POST':
        /* generate new ID and put object into database $db->put($endpoint,$id);*/
        break;
    case 'GET':
        if (strlen($id) > 1) {
            /* fetch object from database $db->fetch($endpoint,$id);*/
            echo $db->fetch($endpoint, $id);
        } else {
            /* return error */
        }
        break;
    case 'PUT':
        if (strlen($id) > 1) {
            /*put object into database $db->put($endpoint,$id);*/
        } else {
            /* generate new ID and put object into database $db->put($endpoint,$id);*/
        }
        //$file = file_get_contents("php://input");
        break;
    default:
        echo "fuckOff";
        break;