5 ms·
Knowing webpage status code and resolving a given address using Java
- peeters 14y agoI'm not sure bringing in JSoup into a basic tutorial is useful, the person reading your tutorial might not want to be doing HTML parsing at all! Plus, it's incredibly easy with the stock Java API: HttpURLConnection connection = (HttpURLConnection) new URL("http://google.com").openConnection(); int statusCode = connection.getResponseCode(); String statusMessage = connection.getResponseMessage();