繁体   English   中英

POST请求不适用于Postman

[英]POST request does not work on Postman

我正在尝试使用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>
                    &nbsp;
                    <input type="hidden" name="scanAction"
                           value=0>
                </td>
                <td>
                    <INPUT TYPE="Submit" VALUE="Refresh"
                           ALIGN="Middle" onClick="scanEvent();">
                </td>
                <td>&nbsp;</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

另外,我已经在路由器管理页面中签入,并且扫描正在进行。 谢谢

您是否已在Postman中将请求方法设置为POST? 默认情况下,它是GET,但是html中的表单指定method =“ POST”,因此请确保同样在Postman中执行此操作。

另外,请确保将值为1的参数scanAction添加到请求的正文中-而不是作为URL参数。

另外,请确保您正确授权了您的请求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM