Groovy web console

subscribe to the feed Subscribe
to this
site

URL availability new

Published 3 months ago by abdul
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
String url = "https://in.gearbest.com/earbud-headphones/pp_009485505501.html?wid=1433363"
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setRequestMethod("HEAD");
int responseCode = connection.getResponseCode();
 
println responseCode