gpt4 book ai didi

xml - POST XML 数据返回 HTTP/1.0 501 Not Implemented 错误

转载 作者:太空宇宙 更新时间:2023-11-04 04:24:16 25 4
gpt4 key购买 nike

我已经在我的 x86 机器上成功尝试了以下代码。没有遇到错误,并且显示一个表,其中包含从 data.xml 中提取的数据。 (Flexigrid 是一个用于显示表格的库。) 在 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 机器的 data.xml 完全相同。

但是,在 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 Not Implemented 到底指的是什么?有人知道解决这个问题的方法吗?

更新:
刚刚注意到,在我的 x86 机器上,如果我浏览 http://localhost/data.xml ,xml 的内容出现在 Firefox 中,但如果我在服务器上浏览 data.xml 作为 http://192.168.3.1/data.xml ,文件 data.xml 被下载,而不是显示在 Firefox 中。

最佳答案

您能否捕获两个不同客户端的 HTTP 请求和响应 header ?最有可能的是,这些是不同的,并且导致来自嵌入式系统的请求被不同地对待。

关于xml - POST XML 数据返回 HTTP/1.0 501 Not Implemented 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10425837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com