04-03-2018 11:22 PM - edited 03-01-2019 09:28 AM
HI experts
I am following the below code in JAVA-
URL url = new URL("http://<hostname:portname>/api/<DSP NAME>/method/Job/get/443083");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setDoInput(true);
conn.setDoOutput(true);
String userNamePassword = "<username>:<password>";
userNamePassword = new String(org.apache.commons.codec.binary.Base64.encodeBase64(userNamePassword.getBytes()));
conn.setRequestProperty("Authorization", userNamePassword);
conn.connect();
// System.out.println(conn.get);
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String resp = "";
String next = null;
while ((next = reader.readLine()) != null)
resp += next;
System.out.println(resp);
I am not getting the desired output(JOB details)
Please suggest me if I am missing something.
Regards
Sourav Chakraborty
Solved! Go to Solution.
04-04-2018 03:59 AM
Try it this way
URL url = new URL("http://<hostname:portname>/api/<DSP NAME>/Job.get/443083");
Note "method" is not used and there is a period between job and get not a slash
Bob Gardner
04-04-2018 03:59 AM
Try it this way
URL url = new URL("http://<hostname:portname>/api/<DSP NAME>/Job.get/443083");
Note "method" is not used and there is a period between job and get not a slash
Bob Gardner
04-04-2018 08:41 AM
Thanks Bob. :)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide