关于MDN上local library的route问题

WEB松
  • 40
// Display Author create form on GET.
exports.author_create_get = function(req, res) {
    res.send('NOT IMPLEMENTED: Author create GET');
};

// Handle Author create on POST.
exports.author_create_post = function(req, res) {
    res.send('NOT IMPLEMENTED: Author create POST');
};

为什么create会有post和get? create不就是一个post方法吗?
能否解释以下注释。。

// Display Author delete form on GET.
exports.author_delete_get = function(req, res) {
    res.send('NOT IMPLEMENTED: Author delete GET');
};

// Handle Author delete on POST.
exports.author_delete_post = function(req, res) {
    res.send('NOT IMPLEMENTED: Author delete POST');
};

为什么delete会有post和get??

// 此处为什么需要一个get?
router.get('/book/create', book_controller.book_create_get);

// 我能过够理解这个
router.post('/book/create', book_controller.book_create_post);

谢谢!

回复
阅读 1.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏