jeudi 25 juillet 2019

Laravel 5 GET api call is working but POST api calls are not working on Server (AWS) But it's working fine on local

In the API routes I am calling a function through POST and GET method. GET method returning data's but POST method throwing method not found exception.

Here is my sample code in routes/api.php

//api.php

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

//login values
Route::post('login', 'Auth\RegisterController@loginAPI');

//Auth\RegisterController.php
    public function loginAPI( Request $request )
    {
        $reqdata = $request->all();
        $usermail = $reqdata['usermail'];
        return $usermail;
    }


It's working fine before 2 months but suddenly it's not works https://imgur.com/6sa7cfK



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire