I have a javascript by which i call a rest api and get a JSON result , I need this result in a java class.
Below is the script
<script type="text/javascript">
function getCurrentTime()
{
var time;
AJS.$.ajax({
url: "/rest/vertygosla/1.0/compute/issue/TST-30",
type: 'get',
dataType: 'json',
async: false,
success: function(data) {
time = data.sla;
}
});
return time[0].remainingTime;
}
alert(""+getCurrentTime())
</script>
json Provided by the server {"issueKey":"TST-30","issueId":11600,"created":"2013-01-31T11:38:38.765+0530","sla":[{"agreementName":"ack times","remainingTime":5860985,"endDate":"2013-01-31T12:00:57.796+0530","startDate":"2013-01-31T11:38:38.781+0530","consumedTime":1339015,"name":"Ack time","id":11000,"delayed":false,"closed":true,"frozen":false}]}
Can someone provide me a similar example in JAVA .
Thanks