Vscode-live-server: Status Code: 405 Method Not Allowed

Created on 10 Aug 2019  路  15Comments  路  Source: ritwickdey/vscode-live-server

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->

Current behavior

This is a duplicate of Issues #54 and #66, but they have been closed. I have tried the suggestions in Issue #54, but they did not work for me (i.e. running on a different port and killing any task running on port 5500).

I have a simple HTML form with method="post". When the form is submitted, Live Server returns a 405 Method Not Allowed. Looking in the browser Developer Tools, the Response header has "Allow: GET, HEAD, OPTIONS".

Expected behavior

I would expect Live Server to not serve back a 405 error :)

Environment

Windows 7 Home, 64-bit

Browser:

- [x] Chrome (desktop) version 76.0.3809.100 (64-bit)
- [x] Firefox version 68.0.1 (64-bit)
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:

- Live Server: 5.6.1
- Platform:  Windows
- Visual Studio Code: 1.36.1

Most helpful comment

Same issue. Just stopped using Live Server in VS Code.

All 15 comments

mark this issue

we are having the same issue, we need help to solve this.

Same issue here too.

Same here

I managed to figure out what it was on my end. I was trying to get a package running (in particular, JQuery File Manager) and the package was trying to use Node.JS server calls to get the files on my server. Since it was only running through Live Server and not an actual Node server, it freaked out and this error was brought up. My fix was to actually transform my project into a real Node server.

I managed to figure out what it was on my end. I was trying to get a package running (in particular, JQuery File Manager) and the package was trying to use Node.JS server calls to get the files on my server. Since it was only running through Live Server and not an actual Node server, it freaked out and this error was brought up. My fix was to actually transform my project into a real Node server.

yow correct me if I am wrong, so you stop using the vs code live server?

I managed to figure out what it was on my end. I was trying to get a package running (in particular, JQuery File Manager) and the package was trying to use Node.JS server calls to get the files on my server. Since it was only running through Live Server and not an actual Node server, it freaked out and this error was brought up. My fix was to actually transform my project into a real Node server.

yow correct me if I am wrong, so you stop using the vs code live server?

Yea, I stopped using LiveServer in favor of using Node.

Same issue.

Request URL: http://127.0.0.1:5500/
Request Method: POST
Status Code: 405 Method Not Allowed
Remote Address: 127.0.0.1:5500

I found the same issue:
$.ajax('data/addToCart.json', { type: 'POST', dataType: 'json', contentType: 'application/json' })

Once I switch from Live Server to NodeJS's node-http-server the issue was no longer happening.

Same issue. Just stopped using Live Server in VS Code.

I just had the same issue.
https://stackoverflow.com/questions/60010357/405-method-not-allowed-in-simple-html-form-php-code

Dropping live server extension seems to solve it for most.

This is still an issue...

This is still an issue:

Here is my code:
const params = {
id: 123,
pepe: cuadrado,
torre: 123456789
}
fetch(url, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(params)
});
and html:






Document



hola, running fetch




Visual Studio Code 1.54.3 from March 15 2021

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpower02 picture mpower02  路  6Comments

GaoHengdong picture GaoHengdong  路  4Comments

ghost picture ghost  路  6Comments

Er-rchydy picture Er-rchydy  路  3Comments

js76155 picture js76155  路  4Comments