Closed wags closed 8 years ago
I have found various solutions to do this. One is to use the ENCODE
function:
ENCODE(algorithm, action, data, dataLoc, result, resultLoc)
Simply pass "URLENCODE"
as the value for algorithm
above.
Another way is to use UDO objects. Upon writing the object to JSON or XML, the proper escaping is done automatically. This is especially helpful when trying to create JSON that contains quote marks in the data. It all comes out in properly-escaped JSON, like \"
.
Hi, I'm working with the
submitRequest
function on a UniVerse server (running v11.2.3). I'm posting data to a web service and am manually crafting the specifically-formatted XML request data it requires and including that as thepost_data
parameter of the function. When I do this, it looks like I'm going to have to manually look for any characters that aren't HTML-safe, like the ampersand (&
) symbol and change it to&
.Is there a built-in/automated way to do it, or has anyone already written a nice routine to handle things like that?
Thanks!