我有以下 HTML 代码。它创建一个表单,一旦我点击提交,就会向服务器发送一个请求。
<html>
<body bgcolor = black text= white>
<FORM method="post" action="/processData.py">
<P>
<LABEL for="firstname">First name: </LABEL>
<INPUT type="text" id="firstname"><BR>
<LABEL for="lastname">Last name: </LABEL>
<INPUT type="text" id="lastname"><BR>
<LABEL for="email">email: </LABEL>
<INPUT type="text" id="email"><BR>
<INPUT type="radio" name="sex" value="Male"> Male<BR>
<INPUT type="radio" name="sex" value="Female"> Female<BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>
</body>
</html>
当我点击提交时,我在我的网络服务器上收到一个 POST http 请求。但不是获取所有字段的值。我只得到单选按钮的值。这是我得到的标题:
POST /Test.html HTTP/1.1
Host: 127.0.0.1:22222
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25
Content-Length: 10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*//*;q=0.8
Origin: http://127.0.0.1:22222
Content-Type: application/x-www-form-urlencoded
Referer: http://127.0.0.1:22222/File.html
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive
sex=Female
我期待数据显示在标题之后。为什么不显示?