问题描述:

I am trying to make a PUT call to edit my database and render to my main page(catalog) after the database has been updated.

i use the following function

app.put('/catalog/tax/', tax.collect, tax.edit, tax.respond);

And the respond function is the following

respond: function (req, res) {

res.redirect('/catalog');

}

The data gets updated but after that i get an error:

"cannot PUT /catalog"

It works perfectly fine if i use a POST call instead to add a row to the database.

网友答案:

Looks like you are using expressjs, You do not need to use .put for edits. Just use .post to make your edit.

相关阅读:
Top