I can do that with "curl" and "httpie" successfully with:
Code: Select all
curl -s --digest \
-u admin:mycampass \
-o /tmp/response \
-w "%{http_code}\n" \
-G "http://amc03462ee3144ebb6.local/cgi-bin/configManager.cgi\
?action=setConfig \
&WLan.eth2.SSID='myWifi' \
&WLan.eth2.Keys[0]='myWifiPassword' \
&WLan.eth2.Encryption=WPA2-PSK-AES \
&WLan.eth2.KeyID=0 \
&WLan.eth2.Enable=true \
&WLan.eth2.KeyType=Hex \
&WLan.eth2.ConnectEnable=true \
&WLan.eth2.KeyFlag=true"
Code: Select all
http \
--auth admin:mycampass \
--auth-type digest \
GET http://amc03462ee3144ebb6.local/cgi-bin/configManager.cgi \
action=='setConfig' \
WLan.eth2.SSID=='myWifi' \
WLan.eth2.Keys\[0\]=='myWifiPassword' \
WLan.eth2.Encryption=='WPA2-PSK-AES' \
WLan.eth2.KeyID=='0' \
WLan.eth2.Enable=='true' \
WLan.eth2.KeyType=='Hex' \
WLan.eth2.ConnectEnable=='true' \
WLan.eth2.KeyFlag=='true'
I believe it is due to the CGI in an Http GET method that behaves strangely with the & character. I tried many ways to encode this character and nothing seems to work. However when setting the Wifi password thought the web interface of the camera, I am able to set a password with the &.
When using &, the error I get is:
Code: Select all
Error
ErrorID=2, Detail=Invalid Request!
Is it possible to change the Wifi password with an Http POST method?
Why I can set this password from the website but I can't do that with curl or httpie?
Do you know any other client/way that makes this "configManager.setConfig" request work?