我使用Slim PHP框架建立了一个REST API,当使用http://mysite.com/class/id这样的请求时,它完美地工作。
但是当我导航到http://mysite.com/时,Safari中出现以下错误:
Safari can’t open the page “http://mysite.com/”.
The error is: “cannot decode raw data” (NSURLErrorDomain:-1015)
Please choose Safari > Report Bugs to Apple, note the error number,
and describe what you did before you saw this message.
请你能告诉我哪里出错了吗?
include_once('config.php');
require 'Slim/Slim.php';
$app = new Slim();
$app->post('/user/create', 'create_user');
$app->get('/user/:id', 'info_user');
$app->post('/user/:id', 'update_user');
$app->delete('/user/:id', 'delete_user');
$app->post('/user/validate', 'validate_user');
$app->get('/user/:id/venues', 'venues_user');
$app->get('/user/:id/queues', 'queues_user');
$app->post('/venue', 'create_venue');
$app->post('/venue/:id', 'update_venue');
$app->delete('/venue/:id', 'delete_venue');
$app->get('/venue/:id', 'info_venue');
$app->get('/venue/:id/queues', 'queues_venue');
$app->post('/queue', 'create_queue');
$app->post('/queue/:id', 'update_queue');
$app->delete('/queue/:id', 'delete_queue');
$app->get('/queue/:id', 'info_queue');
$app->run();