node.js - 在某些输入未填写时从表单发送数据
问题描述
<form action="/test" method="post>
<input type="text" name="something">
<input type="text" name="something_again">
<button type="submit"></button>
</form>
当我填写两个输入时,数据会在 req.body 中发送,我可以随意使用它们,但如果我只填写一个输入或不填写任何输入,则什么都不会发生并且 req.body 为空。当没有填写所有输入时,我该怎么做才能在 req.body 中有数据?
解决方案
推荐阅读
- graphql-js - GraphQL [graphql js] 循环依赖: * 的类型必须是 Output Type 但得到: [object Object]
- javascript - 当 followPointer 标志打开时,Highcharts 工具提示显示箭头/插入符号
- javascript - Javascript 检查数组中的重复对象并将值合并到数组中
- android - 程序类型已存在:com.google.android.gms.common.util.VisibleForTesting -':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
- c# - 如何在 Linq 中编写嵌套的 Sql 查询
- java - 组合多个加密密钥以生成加密密钥
- sql - 查询以列而不是行返回记录值?
- iis - IIS 中的 URL 重写添加字符
- three.js - 三.Object3D:.eulerOrder 现在是 .rotation.order
- r - 使用 roxygen2 在 R 中构建包时未创建文档