I want to open a link from url : "http://www.kohls.com/search.jsp?search=jacket&submit-search=web-regular", sometimes i get:
java.io.IOException: Server returned HTTP response code: 403 for URL. But it's ok when open the url using browser. Below is part of my code:
URL url = new URL("http://www.kohls.com/search.jsp?search=jacket&submit-search=web-regular");
InputStream is = url.openConnection().getInputStream();
error detail
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.kohls.com/search.jsp?N=0&search=jacket&WS=96 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627) at Links.main(Links.java:41)