laravel - 从 http 请求中获取参数
我想将多个参数从我的Angular应用程序传递到我的Laravel API,即用户提供的和数组。idchoices
角:
http 请求:
verifyAnswer: function(params) {
    return $http({
        method: 'GET',
        url: 'http://localhost:8888/api/questions/check',
        cache: true,
        params: {
            id: params.question_id,
            choices: params.answer_choices
        }
    });
拉拉维尔 5:
路线.php:
$router->get('/api/questions/check/(:any)', 'ApiController@getAnswer');
ApiController.php:
public function getAnswer(Request $request) {
    die(print_r($request));
}
我认为我应该在我的URI中使用来指示我将传入任意数量的各种数据结构的参数(id是一个数字,选择是一个选择数组)。:any
如何提出此请求?
[200]: /api/questions/check?choices= choice+1 &choices= choice+2 &choices= choice+3 &id=1
 
					 
				 
				    		 
				    		 
				    		