Я не могу извлечь строку из объекта JSON в транспортир в веб-шторме. Я хочу значение statusCode i.e: 200, код, который я пробовал для этого, упомянут ниже:
КОД:
console.log('body is :' + JSON.stringify(body));
var jsonResponse = JSON.stringify(response);
console.log('---------response is: '+ jsonResponse);
var statusResponse = jsonResponse.getString("statusCode");
console.log('---- statusResponse is :'+ statusResponse.toString());
ВЫХОД IS:
body is :{"oBody":{"payLoad":{"sLoginId":"HDB_TW_DSA@softcell.com","iInstId":4019,"sFirstName":"PRIYANKA","sLastName":"MADGUNDI","sEmail":"priyanka@softcell.com","sEmpId":"HDB18458","sMobile":"8237276692","bActive":true,"aRoles":["DSA"],"aDealers":[{"id":"TW423684019","iInstId":4019,"iDlrId":"42368","sDlrName":"GODSPEED MOTORCYCLE PVT LTD","iBranchId":1278,"sBranchName":"HYDERABAD-SF","sProduct":"TW","bActive":true},{"oStatus":{"iStatus":200,"sStatus":"OK"}}
--------- ответ:
{"statusCode":200,"body":{"oBody":{"payLoad":{"sLoginId":"HDB_TW_DSA@softcell.com","iInstId":4019,"sFirstName":"PRIYANKA","sLastName":"MADGUNDI","sEmail":"priyanka@softcell.com","sEmpId":"HDB18458","sMobile":"8237276692","bActive":true,"aRoles":["DSA"],"aDealers","path":"/gonogo-api/atm/login-web-v3","href":"https://ssg.serviceurl.in/login-web-v3"},"method":"POST","headers":{"Postman-Token":"7aad048f-f8ad-4765-a0b8-be3b3a485ab6","cache-control":"no-cache","Content-Type":"application/json","accept":"application/json","content-length":380}}}