这是一个创建于 2611 天前的主题,其中的信息可能已经有所发展或是发生改变。
小弟不才,请大家告知,非常感谢,如下。
在 html 里代码 1:
<div class="input-red">
<input type="number" name="math_word" class="form-red2" orders="请输入 20--50 之间的金额">
</div>
在 html 里代码 2:
<div class="input-yellow">
<input type="text" name="math_word" class="form-yellow2" orders="请输入问题的正确答案">
</div>
====================
想用 python 的 requests.post 里提交数据:
answer=raw_input("填入正确的")
data={"math_word":answer}
-------------------------------------------
请问在 html 里的数据类型会影响我的数据提交吗?
比如<input type="number"和<input type="text"
如果有影响,请问需要在<input type="number"这个数据类型下把 raw_input 获得的字符串转为 int 吗?
3 条回复 • 2017-08-30 00:50:13 +08:00
|
|
1
phy25 2017-08-29 23:59:42 +08:00 2
不影响,input:type 只是给浏览器提示 input 该显示成什么样,上传的数据都是 string,这个 type 不会进到 POST 的 data 里;到了服务器之后的类型变换都是服务器自己干的。
|
|
|
2
hititan 2017-08-30 00:46:57 +08:00
哦,明白了,非常感谢你的回答,这对我非常有用,再次感谢你!!!
|
|
|
3
CEBBCAT 2017-08-30 00:50:13 +08:00 via Android 1
小提示一下:有专门的感谢按钮的,但单发一层来感谢也是很棒,就是忘记 @ 他了
|