vendredi 30 juin 2017

Java - Reading web page after authentication

I've written a code in Java that parses some information from my university's Moodle site. To read the html page i'm using java.net.URL:

URL url = new URL(link);
URLConnection connection = url.openConnection();
InputStream is = connection.getInputStream();

The thing is, the site has an authentication system (using SSL) and even though I've logged in before running the code, it reads the main page (before authentication).

Any ideas how can I fix this thing? Thanks!




Aucun commentaire:

Enregistrer un commentaire