在 Lumen Laravel 5.4 POST 方法中不起作用

In Lumen Laravel 5.4 POST method not working

我正在使用 lumen laravel 作为后端。我正在尝试使用 angular2 从前端执行 POST 方法。 GET 方法工作正常。但是当尝试使用 POST 方法时,我收到错误消息 405 Method Not Allowed Method not allowed 405 error

routes/web.php $app->post('/insert_data', 'ExampleController@testInsert');

问题出在我们需要发送的数据上。在发送之前,您必须将 JSON 数据字符串化。例如:JSON.stringify(值)

this._http.post('http://local.amazonlaravel.com/api/add_products',JSON.stringify(values),{
})
.subscribe(
  res => {        
    // console.log(values);
  },
  err => {
    console.log("Error occured");
  }
);