I am doing some wget calls within a python script, where I issue some PUT method to send some commands, but when python is parsing the wget command which I would like to send out, it reports an KeyError on a variable within the wget call.
The command that I create is
wget = "wget --http-user={user} --http-password={password} --header='Accept:application/json' --header='Content-Type:application/json' --method=PUT --body-data='{'mode':'{bodyD}'}' -O- http://{IPaddress}/api/{v}/{cm}" .format(user=usr,password=pswd,IPaddress=node,v=version,bodyD=bodyData,cm=Command)
And the KeyError is "KeyError:'mode'", when sending out that command. What is the error coming from? Do I have to scape the word "mode" because it is reserved?
Thanks in advance,
Regards,