【发布时间】:2017-01-05 19:24:01
【问题描述】:
我正在使用 Laravel 5.2 和 Dingo API 包创建 API。创建用户时,我想用新的$user->id 返回201 响应。
我的代码
return $this->response->created();
根据Dingo documentatio,我可以在created() 函数中提供location 和$content 作为参数。
我的问题是,我需要在这里返回什么位置信息,我尝试将我的新用户设置为 $content,但它不起作用或者我不确定会发生什么。
谁能解释一下这个created()函数?
【问题讨论】:
标签: rest api laravel laravel-5.2 dingo-api