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

SandunLK's avatar

Laravel 5.4 Error 405 Method Not Allowed Error

I have Laravel 5.4 and VueJs application. When I run it in Localhost it was worked but now. I host in a server it gives the error GET > 405 Method Not Allowed Error. But GET requests are work fine. But this function I'm not using GET request. I using POST. But I giving this error. I have Installed CORS also. What can I do?

This is my POST Request in VueJS

this.$http.post("api/sendbooking",this.booking)
    .then(function (response){

          console.log(response)
    })

This is api.php

Route::post('/sendbooking',[
'uses' => 'BookingController@setBooking'
])
0 likes
8 replies
bashy's avatar

What does the request look like in your browser?

1 like
SandunLK's avatar

It shows as GET request. But I don't use GET Requests.

arukomp's avatar

@SandunLK look at chrome's inspector, network tab. Make the request, and see if it's really a POST request. Also, make sure you're not sending a "_method": "GET" in your post body

SandunLK's avatar

I'm using vue resource so how to check the post body

arukomp's avatar
arukomp
Best Answer
Level 10

chrome dev tools, open Network tab, make a request, click on that request in the Network tab and scroll down to Request Headers which will also have the body of the request

bashy's avatar

That doesn't show the HTTP request method.

2 likes
SandunLK's avatar

Please tell me how to do it correctly in Vue.JS

Please or to participate in this conversation.