I have a problem with the http calls in my api.
The thing is that i have this http POST call:
axios.post("/api/crear/dimension/", data).then((response) => {
this.success();
console.log(response.data);
}).catch((response) => {
this.error(response)//;
})
Using axios because vue resource is getting deprecated.
the thing is that when i want to trigger the call this happens :
GET http://localhost/api/crear/dimension 405 (Method Not Allowed)
Notice how chrome takes this as GET call instead of a POST one. IDK why
But when i do a GET call everything works fine.
this is my route file in laravel:
Route::group(['middleware' => 'auth:api'], function () {
Route::get('/user', function (Request $request) {
return $request->user();
});
Route::post('/crear/dimension/', 'AdminController@createDimension');
});
PS : Im using the passport package in laravel. Everything is configured well because i can get a GET call with no problems. The thing is in the POST call,
I did a put , patch call too. Same result as above,
i have tried with vue resource aswell but nothings works
//EDIT
I removed the slashes from the end of the api calls and i got a 401. For more info go HERE