samedi 29 avril 2017

Laravel 5.3.31 post method returning 405 method not allowed

I am getting '405 method not allowed error' when I am going to send post reques using AngularJS http.post.

Below is my angular JS code:

var headers = new Headers();
        headers.append('Content-Type', 'application/json');
        return this.http.post(this.baseUrl + '/user/authenticate-user', JSON.stringify({"email": email, "password": password}), {
            headers: headers
        }).map((response: Response) => {

            }
        });


- Below is my route in web.php
Route::post('user/authenticate-user', 'UserController@postLogin');

- I have written postLogin method in UserController controller.

Please help me if anyone face same issue.

[enter image description here][1]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire