I am building a HTTP Adapter in Worklight. Normal communication between the server and application works great, but I need to retrieve an image from the server. The image can be downloaded using a URL which contains the image ID, but I don't know how I can return the whole URL and not only the path. A simple version of my function is:
function getFile(id) {
if (typeof id == 'undefined') return {isSuccesful : false};
return {isSuccesful : true, url : '/api/media/get/' + id.toString()};
}
But my path returns only:
'/api/media/get/1'
The URL I need is:
'http://www.example.com/api/media/get/1'
How can I retrieve the domain from the .xml file?