You can use the normal XMLHttpRequest object as if you are in a regular browser instead if you like.
But if you need to use the app.HttpRequest() method for some reason (for example you have CORS issues) then this is an example of how you use it:-
"origin=Toronto|destination=Montreal|avoid=highways|mode=bicycling",
OnHttpResult );
There is an extra 'headers' parameter which is not included in the above example, but you should be able to use that to set your user agent etc by setting that parameter to something like this:-