我正在尝试以编程方式从我的路由器使用API调用获取一些信息,所以我在POSTMAN中测试它们。我已经完成了授权,但是当我尝试获取近WIFI AP时,呼叫结果不会显示。这是回复
<html>
<head>
<title>Scan Results</title>
<script language="JavaScript">
function scanEvent() {
window.document.wlanScanPopup.scanAction.value = 1;
window.document.wlanScanPopup.submit();
}
function onLoadScript() {
setTimeout("window.location.reload();", 1500);
}
</script>
</head>
<body onLoad="onLoadScript()">
<form action="/goform/wlanScanPopup" method="POST"
name="wlanScanPopup">
<table>
<tr>
<td>
<img border="0" src="logo_new.gif" width="200"
height="31">
</td>
<td>
<td>
<input type="hidden" name="scanAction"
value=0>
</td>
<td>
<INPUT TYPE="Submit" VALUE="Refresh"
ALIGN="Middle" onClick="scanEvent();">
</td>
<td> </td>
<table style="font-family: Helvetica;font-
size:14">
<tr bgcolor=#009639>
<th colspan=9>
<b>Nearby Wireless Access Points</b>
</th>
</tr>
<tr bgcolor="#009639">
<th>Network Name</th>
<th>Security Mode</th>
<th>Mode</th>
<th>PHY Mode</th>
<th>RSSI</th>
<th>Channel</th>
<th>Bandwidth</th>
<th>BSSID</th>
</tr>
</td>
</tr>
</table>
</form>
</body>
</html>
我在这里看到的是,加载HTML后,它会更改隐藏输入的值并提交。我试图用键scanAction和值1发送请求,但没有任何反应。知道如何让他实际提交和工作吗?请求为http://192.168.0.1/goform/wlanScanPopup
此外,我已经检查了路由器管理页面,扫描工作正常。 感谢
答案 0 :(得分:0)
您是否已将请求方法设置为Postman中的POST?默认情况下它是GET,但是html中的表单指定method =“POST”,所以请确保你也在Postman中执行此操作。
另外,请确保将参数scanAction
的值1
添加到请求的正文中 - 而不是作为网址参数。
另外,请务必正确授权您的请求。