jeudi 8 octobre 2015

Java Client code to call restful web service

Can anybody tell me how to write a java client code to call restful web service with one parameter say email? I am trying the below code. But I am getting response as Success. Once this is success, I need the below XPHONE value. How to get this value?

XPHONE: 52-33-3669-7000

Here is the client code:

URL url = new URL(
                                "http://ift.tt/1VGoTQE");
                        HttpURLConnection conn = (HttpURLConnection) url
                                .openConnection();
                        conn.setRequestMethod("GET");
                        conn.setReadTimeout(15000);
                        conn.setConnectTimeout(15000);
                        conn.setRequestProperty("Accept",
                                "application/json");
                        conn.connect();




Aucun commentaire:

Enregistrer un commentaire