boa 服務器進行 cgi 測試時出現 400 Bad Request 【已解決】

一、相關信息html

1)嵌入式開發時用到了 boa 服務器,主要是對cgi 部分的需求。瀏覽器

2)boa 服務器已經架設好,主目錄爲 /var/www,cgi目錄爲 /var/www/cgi-bin/服務器

3)boa 服務已經開啓post

 

二、問題描述spa

1)將 test.html 放在 /var/www 下,代碼內容以下:code

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

2)經過瀏覽器調用該網頁orm

瀏覽器中輸入: localhost/test.htmlhtm

點 call 後,出現以下提示:blog

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

 

三、問題解決開發

1)將test.html 中的 method=post 部分改成get 後問題解決。

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


2)boa 自己是支持 post方式的,經過查看 error.log,提示 錯誤的數據長度,0。

是否填充一些數據再使用 post 方式就能夠了,目前未作考證。

相關文章
相關標籤/搜索