如何解决带有curl
嘿,我只是在玩fritzbox API并尝试使用curl设置SSID。我知道有像fritzconnection这样的python库可以使事情变得更容易,但是我有两个使用curl的理由。
所以我的实际命令如下:
curl -s "http://192.168.178.1:49000/upnp/control/wlanconfig1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:dslforum-org:service:WLANConfiguration:1#SetSSID:NewSSID#test-net" -d "@ssid.xml"
ssid.xml的内容是
<?xml version="1.0" encoding="utf-8" ?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:SetSSID xmlns:u="urn:dslforum-org:service:WLANConfiguration:1" />
</s:Body>
</s:Envelope>
有人有使用过SOAP或XML的经验吗?
我当前的错误提示
enter code here<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>401</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
我想我的命令目前无效...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。