JSON update status with space / bad request
Posted: Sunday 04 June 2017 11:02
Hello,
Fairly basic question, how can I escape a string so that a white space is accepted inside a string?
When the stlVal is "Geen vraag" I get a 400 Reason: Bad Request, offcourse I can change it to "Geen_vraag" to get it working.
def Domoticz(strIdx, strVal, strDesc = '', strWP_ID = ''):
strJson='/json.htm?type=command¶m=udevice&idx='+strIdx+'&svalue='+strVal
Fairly basic question, how can I escape a string so that a white space is accepted inside a string?
When the stlVal is "Geen vraag" I get a 400 Reason: Bad Request, offcourse I can change it to "Geen_vraag" to get it working.
def Domoticz(strIdx, strVal, strDesc = '', strWP_ID = ''):
strJson='/json.htm?type=command¶m=udevice&idx='+strIdx+'&svalue='+strVal