Home > Blockchain >  All requests ends up in GET route. Laravel
All requests ends up in GET route. Laravel

Time:10-02

I have a Laravel(8.83) application. API routes end up in GET requests always.

To check the problem I have deleted all the routes except one. Now I have just one route:

Route::put("cart/{id}", function(Request $request, $id) {
    return $request->all();
});

Although I make PUT request on the postman, the result is: "The GET method is not supported for this route. Supported methods: PUT."

Postman Image

enter image description here

I have tried PUT, PATCH, POST, DELETE, and OPTIONS. All ended up in the same error.

CodePudding user response:

The request method is probably getting modified in Postman or in webserver config, or in .htaccess.

Here's one thread on a similar issue in Postman - Postman support

For a reference to a working .htaccess - Laravel .htaccess GitHub

CodePudding user response:

Sometime this problem due to postman. please try any other like (Repid api client or thunder client).

  • Related