Something like that. My guess is that you are building a URL to call from within a web page. I would suggest that you use jQuery, and instead of building a long URL string with argument as name-value pair, you use $.ajax() to call the URL, with the argements in an object.
Below is a code snipped from a web application I am working on right now, doing exactly that. The code calls a Lotusscript agent on the server. The agent reads the argments passed to it and updates a Notes document, then pass back JSON sith success or failure info, error messages, etc.