I have some application that should connect to https Site, and receive some. With connection all is ok, but when i what getInputStream() comes Exception:
java.io.IOException: Server returned HTTP response code: 403 for URL:
Here is the part of code:
String query = siteURL.toExternalForm();
URL queryURL = new URL(query);
String data = "username="+login+"&password="+password;
URLConnection connection = queryURL.openConnection();
connection.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(connection
.getOutputStream());
writer.write(data);
writer.flush();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));