You are not logged in.
Dear AB,
function registerSoa(){ //access mORMot SOA
let xhr = new XMLHttpRequest();
let url = new URL("http://localhost:888/root/Calculator._contract_");
signature = sessionSignature();
url.searchParams.set("session_signature",signature);
xhr.onload = function() {
if (xhr.status == 200){
let hasil = xhr.response;
console.log(hasil.result[0]);
runSoa();
};
};
xhr.open('POST', url);
xhr.responseType = 'json';
xhr.send();
};
Calculator._contract_ return a number. What number is it ? Do I need to use it before call Calculator.Add ?
So far I just ignore it, and send the next step, server response it.
Tq
Offline
This is the "contract" of the interface, i.e. the hash of all methods and parameters.
It allows to ensure that the interface is the same on both client and server side, so that you can e.g. use a JSON array of unnamed parameters as input/output instead of a JSON object of named parameters.
Just search for the documentation about it.
Offline