[英]POST XML data returns HTTP/1.0 501 Not Implemented error
我已經嘗試在x86機器上成功執行以下代碼。 沒有遇到錯誤,並且顯示了一個表,其中包含從data.xml中提取的數據。 (Flexigrid是用於顯示表的庫。) [10:37:42.196] POST http://localhost/data.xml [HTTP/1.1 200 OK 1ms]
在Firefox的日志中收到[10:37:42.196] POST http://localhost/data.xml [HTTP/1.1 200 OK 1ms]
消息。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Flexigrid</title>
<link rel="stylesheet" type="text/css" href="./css/flexigrid.css">
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="./js/flexigrid.js"></script>
</head>
<body>
<table id="flex1" style="display:none"></table>
<script type="text/javascript">
$("#flex1").flexigrid({
url: '../data.xml',
dataType: 'xml',
colModel : [
{display: 'Ports', name : 'port', width : 50, sortable : true},
{display: 'Rx bytes', name : 'rx_bytes', width : 50, sortable : true},
{display: 'Rx drop', name : 'rx_drop', width : 50, sortable : true},
{display: 'Rx errs', name : 'rx_errs', width : 50, sortable : true},
{display: 'Rx frame', name : 'rx_frame', width : 50, sortable : true},
{display: 'Rx over', name : 'rx_over', width : 50, sortable : true},
{display: 'Rx CRC', name : 'rx_crc', width : 50, sortable : true},
{display: 'Tx pkts', name : 'tx_pkts', width : 50, sortable : true},
{display: 'Tx bytes', name : 'tx_bytes', width : 50, sortable : true},
{display: 'Tx drop', name : 'tx_drop', width : 50, sortable : true},
{display: 'Tx errs', name : 'tx_errs', width : 50, sortable : true},
{display: 'Tx coll', name : 'tx_coll', width : 50, sortable : true}
],
sortname: "port",
sortorder: "asc",
usepager: false,
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 746,
onSubmit: addFormData,
height: 200
});
function addFormData(){
//passing a form object to serializeArray will get the valid data from all the objects, but, if the you pass a non-form object, you have to specify the input elements that the data will come from
var dt = $('#sform').serializeArray();
$("#flex1").flexOptions({params: dt});
return true;
}
$('#sform').submit(function (){
$('#flex1').flexOptions({newp: 1}).flexReload();
return false;
});
</script>
</body>
</html>
但是,當我在基於ARM的交換機上嘗試相同的代碼時,將出現一個空的flexigrid表。 在這種情況下,發現data.xml與x86計算機完全相同。
但是,在firefox的日志中,我收到以下消息: [10:24:57.611] POST http://192.168.3.1/data.xml [HTTP/1.0 501 Not Implemented 3ms]
其中192.168.3.1是交換機的IP。 HTTP / 1.0 501未實現到底指的是什么? 有人知道解決此問題的方法嗎?
更新:
只是注意到在x86機器上,如果我瀏覽http://localhost/data.xml ,則xml的內容出現在firefox中,但是如果我在服務器上以http://192.168.3.1/data.xml的形式瀏覽data.xml的話,則會下載文件data.xml而不是顯示在firefox中。
您可以捕獲兩個不同客戶端的HTTP請求和響應標頭嗎? 這些很有可能是不同的,並且導致對嵌入式系統的請求的處理方式有所不同。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.