Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Danlog's avatar

404 API Route when route is called through AXIOS or Insomnia

Hello, hope everyone is doing fine. I'm getting a little problem that is confusing me a lot.

Well, in my api.php route folder, I got the following: Route::post('send/group/{id}', 'MessengerController@send'); and it appears to be working when I put it in the browser, I do get the The GET method is not supported for this route. Supported methods: POST. .

But when I try to execute it in Insomnia, I get a 404.

Any ideas of why this is happening?

In the browser I'm doing it the following way: http://page.test/api/auth/send/group/1

In axios:

axios.post(`http://page.test/api/auth/send/group/${this.props.navigation.getParam('id')}`,
                        {
                            message: this.state.message
                        },
                        {
                            headers: {
                                'Authorization': access,
                            }
                        })

and in insomnia:

http://page.test/api/auth/send/group/1

0 likes
3 replies
Sergiu17's avatar

Route::post('send/group/{id}', 'MessengerController@send');

I don't see anything related to auth before send/group/{id}

Run php artisan route:list to see full details about routes

Danlog's avatar

Sorry, didn't include it up there. In the beginning you can find the following:

      'middleware' => 'auth:api', 'verified'
    ], function() {
Danlog's avatar

Also, ran the command and............

| | POST | api/auth/send/group/{id} | | App\Http\Controllers\MessengerController@send | api

Please or to participate in this conversation.