ScriptableHTTPRequest in the DataMapper

Hi,

I tried to use the new ScriptableHTTPRequest in the Datamapper, but it didn’t work. Is there a short example how to use it properly?

My attempt (the way, I would use a XMLHttpRequest):

var request = createHTTPRequest();
var url = ‘http://13.200.129.182:48081/metadata/start?jobId=8103522&docId=1’;
request.open(“GET”,url);
request.send();

This resulted in an error: Can’t find method com.objectiflune.datamining.scripting.ScriptableHTTPRequest.open(string,string).

Thanks for the help and best regards!

The ScriptableHTTPRequest object requires you to pass a username & password in the open() method. You can pass them as empty strings if you don’t use them:

request.open("GET",url,"","");

Thanks Phil!

That worked.

Some documentation on the ScriptableHTTPRequest would be great, because others than stated in the docs, it doesn’t really resemble the XMLHttpRequest ,and the context completion doesn’t work for this.

Thanks once again!