2

I use wget in windows and it works pretty well with basic http requests but when I run the command below, which basically an action URL on snom phones. it doesn't run it and gives me the message below the link. anyone know how to solve this?

Action URL:

 http://Phone-IP-Address/dummy.htm?settings=save&setting_server=http://WEB-Server-IP/settings.xml&store_settings&=save

Results

syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-03-12 10:10:53--  
Connecting to `192.168.1.100:80`... connected.
HTTP request sent, awaiting response... 200 Ok
Length: 0 [text/html]
Saving to: `dummy.htm@settings=save'

[ <=>                                   ] 0           --.-K/s   in 0s

2013-03-12 10:10:53 (0.00 B/s) - `dummy.htm@settings=save' saved [0/0]

'setting_server' is not recognized as an internal or external command, operable program or batch file.
'store_settings' is not recognized as an internal or external command, operable program or batch file.
Shog9
  • 156,901
  • 35
  • 231
  • 235
Moh
  • 25
  • 1
  • 6
  • I suggest playing around with URL-percent-encoding, see i.e. https://stackoverflow.com/questions/3840762/how-do-you-urlencode-without-using-system-web – svenno Mar 11 '18 at 20:09

1 Answers1

0

The & character in Windows is a special character telling the shell to execute multiple commands in one line. So you have to enclose your URL in double quotes:

"http://Phone-IP-Address/dummy.htm?settings=save&setting_server=http://WEB-Server-IP/settings.xml&store_settings&=save"

This way, the shell doesn't try to parse it as part of the command, but will treat it as a single argument, a single blob of string, and hence the & characters are not treated as command separators too...

It has a special meaning in Linux too:

  • a single one will run the command asynchronously, in the background
  • && means logical AND
ppeterka
  • 20,583
  • 6
  • 63
  • 78