Express处理GET/POST请求(POST请求包含文件) GET 使用简洁的pug模板引擎,写一个表单,提交方法是GET 前端页面代码 enctype,默认是application/x-www-form-urlencode doctype html html form(action="/ex_get" method="GET") label(for="fieldName") 名字: input(type="text" i
POST表单400错误: 正确做法: Add this in the head section of your layout: <?= Html::csrfMetaTags() ?> --------------------------------- 不推荐的做法,以下做法是取消CSRF令牌验证: Add this in your controller: public $enableCsrfValidation = false; 别的方法: 原来是csrf验证的问题,因为表单是自己写的,在Y