import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public static JSONObject getJSONMessage(){
Document doc;
JSONObject jObject;
try {
doc = Jsoup.connect("http://dummy.com/MyServlet").ignoreContentType(true).get();
jObject = new JSONObject(doc.text());
} catch (IOException e) {
e.printStackTrace();
}catch(org.json.JSONException e){
e.printStackTrace();
}
return jObject;
}
No comments:
Post a Comment