curl response is different from the responce of java.net.URL -
curl -v https://whatwg.org/html
header is:
http/1.1 301 moved permanently
location: https://html.spec.whatwg.org/multipage
however..
string link = "https://whatwg.org/html"; url url = new url(link); httpurlconnection conn = (httpurlconnection) url.openconnection(); int status = conn.getresponsecode(); system.out.println("response code ... " + status);
response code ... 200
the first , second results different, doing wrong , how should receive 301 ?
Comments
Post a Comment