06-10-2019 04:00 AM
Hello everyone.
I create line notify in LabVIEW 2018 to send notifications to mobile. The problem is the line notify doesn't send ampersand and percent sign. What's the reason?
Thank you in advance.
06-10-2019 04:48 AM - edited 06-10-2019 04:49 AM
You probably need to escape that text in some way.
Shouldn't the data be JSON? So like: "message":"%&"? Or is that just for the cURL part?
Anyway, the message gets send, but is rejected by the server. So it's more a question to the server side. The spec isn't really clear...
06-10-2019 11:46 AM - edited 06-10-2019 11:48 AM
Hi therinoy,
For sending a application/x-www-form-urlencoded message you need to escape certain characters. You can see an introduction on wikipedia that shows an example of how characters like % are escaped.
The wikipedia article describes the following rules for escaping characters when using application/x-www-form-urlencoded:
Keys and values are both escaped by replacing spaces with the '+' character and then using percent-encoding on all other non-alphanumeric characters.
Since the % character and the & character are both non-alphanumeric, they will both need to be encoded to become %25 and %26 respectively. So to set the message property to the characters %& you have to encoded them as %25%26.