Sending multidimensional json object to the server (PHP) but it is not possible to send a multidimensional json object here is my code:
DOJO code:
var ObjArry=[];
var test1 = {key:value, key:value, key:value, key:value};
var test2 = {key:value, key:value, key:value, key:value};
ObjArry.push(dojoJson.toJson(test1 ,true));
ObjArry.push(dojoJson.toJson(test2 ,true));
request.post("services/service.php?where=saveObj",{
data: ObjArry,
handleAs: "json",
sync: true,
timeout:13000,
headers: { "Content-Type": "application/json", "Accept": "application/json" }
}).then(function(data){
console.log(data); //output - null
});
Server side (PHP) code:
//saveObj is php function
function saveObj(){
print_r($_POST);
}
And the output I get is:
Array()