I have a Rest API - http://10.199.4.46:8081/jira/rest/api/2/issue/CQ-12836?expand=changelog which returns Json in response.
How do we make Rest call with HttpGet using Basic auth to consume JSON response & iterate it in spring mvc in Java?
I have written the below code but not sure that it is correct or not.
//rest call to fetch the issue
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("http://10.199.4.46:8081/jira/rest/api/2/issue/CQ-12836?expand=changelog");
HttpResponse response = null;
request.addHeader(BasicScheme.authenticate(
new UsernamePasswordCredentials("acUser", "acPsswd"),
"UTF-8", false));
我不确定如何调用rest服务并获取json响应。
请在这里帮助我。