0

I want to create little Java application which can interact with secured website.

We have Railway site (https://irctc.co.in) I want to create a console application from which I can send the usename and password to site as web post method and the result can be converted into console format.

Instead of opening the site in web browser, i would like to make it simpler using console window by avoiding other web elements and ads etc..

is it possible to do in Java? Please guide me.

  • For base knowledge of http requests, read http://stackoverflow.com/questions/2793150/how-to-use-java-net-urlconnection-to-fire-and-handle-http-requests, it covers java.net.httpUrlConnection and has link to Apache's httpClient. For https, just search in SO will certain keywords and you will find something. – coolcfan Dec 29 '11 at 07:12
  • Try wget. This is originally a UNIX command, but here is a Windows version: http://users.ugent.be/~bpuype/wget/ – Adriaan Koster Dec 29 '11 at 08:59

1 Answers1

0

I see two ways to do that. The first one is to implement java app based on top of HTTP request-respond engine. In this way you do not have to make any changes in your web-site but processing HTTP responds could be complicated due to design features. The second one is to create simple front-end service on Rails for special cases and interact with in your console app. For message format you can use JSON for example. This way IMHO is more suitable. Both way suggests use of HTTP libs stack, Apache has it there http://projects.apache.org/projects/commons_httpclient.html

Viktor Stolbin
  • 2,746
  • 3
  • 27
  • 48