boa 服务器进行 cgi 测试时出现 400 Bad Request 【已解决】

1、相关信息

1)嵌入式开发时用到了 boa 服务器,主要是对cgi 部分的需求。

2)boa 服务器已经架设好,主目录为 /var/www,cgi目录为 /var/www/cgi-bin/

3)boa 服务已经开启

 

2、问题描述

1)将 test.html 放在 /var/www 下,代码内容如下:

<html>
<body>
<form action="/cgi-bin/test.cgi" method=post>
<input type=submit value="call">
</form>
</body>
</html>

2)通过浏览器调用该网页

浏览器中输入: localhost/test.html

点 call 后,出现如下提示:

400 Bad Request
Your client has issued a malformed or illegal request.

 

3、问题解决

1)将test.html 中的 method=post 部分改为get 后问题解决。

<form action="/cgi-bin/test.cgi" method=get>


2)boa 本身是支持 post方式的,通过查看 error.log,提示 错误的数据长度,0。

是否填充一些数据再使用 post 方式就可以了,目前未做考证。

 

posted @ 2015-03-25 15:03  阿青1987  阅读(1339)  评论(0编辑  收藏  举报